wiki:OurTutorial

Version 16 (modified by pfusik, 12 years ago) (diff)

--

What is what

SVN = Subversion = a tool for file repository with full change history.

Trac = web application that includes a wiki, SVN view and tickets.

Ticket = submitted bug or idea, e.g. jhusak submitted ticket:1 for putting ASMA in the SVN and pfusik did it.

Language

Make sure Trac interface is in English. Polish translation is incomplete.

On the top click Preferences, Language, English (United States), Save changes.

Trac navigation

On the top bar:

  • Wiki
  • Timeline - Traca + SVNa history, e.g.
    • wiki page edit
    • ticket - bug or idea
    • changeset is a change in SVN (e.g. in changeset:4 I have uploaded ASMA 3.4)
  • Roadmap - our goals and how far we are according to tickets
  • Browse Source - read-only view on the SVN
  • View Tickets
  • New Ticket
  • Search

SVN Basics

SVN (subversion) is a version control system. In such systems nothing is ever lost, the history of changes is always available with the author, you can always revert to a previous version and fix any problem (see below).

As you can see in the Browse Source tab, there are three top directories in SVN:

  • branches - for the more advanced users, we don't use it yet
  • tags - contains tagged versions, for example I have put ASMA 3.4 here, we can put here all releases and betas, but we don't edit files directly here
  • trunk - it's the main work space, you can browse it from Trac, but it's much more comfortable to have a copy on your disk (see below)

Every write to SVN is registered in its history - which you see in Timeline. A write is a "changeset". A changeset has the following attributes:

  • ordinal number
  • author's login
  • timestamp
  • log message - short text written by the author to summarize the change
  • the changes - added/changed/removed files or directories

SVN can be browsed from Trac. To make changes, you need an SVN client. The most popular SVN client for Windows is TortoiseSVN.

TortoiseSVN Installation

http://tortoisesvn.net/downloads.html Choose 32-bit or 64-bit to match your Windows version. Any installation is fine, you can uncheck the unnecessary things such as extra icons, command-line tools and dictionaries. After the installation the context menu of Windows Explorer has additional TortoiseSVN commands.

Getting a local copy of SVN

Create on your disk an ordinary empty directory to contain your copy of SVN. Let's say it's called asma-trunk (use any name and location you like). Enter this directory in Windows Explorer, click the empty space and select TortoiseSVN / Checkout. In the URL of repository pase: svn://84.201.216.109/test/trunk Make sure that Checkout directory is exactly your empty directory. Click OK and wait for the download.

The downloaded files are regular files - you can play and edit them. However, delete, rename and move must be done specially (see below).

Basic SVN commands

Right-click on your directory gives you the following commands:

  • SVN Update - download new changes if someone made them
  • SVN Show Log - history (like Trac's Timeline, but limited to SVN changes)
  • SVN Commit - upload your local changes; this may block if someone made changes to the same file as you - in this case do SVN Update and resolve the conflicts (more info on demand: pfusik)
  • SVN Revert - reverts your local changes, replacing the files with their SVN version (cannot be undone, use with care''')

There are many other commands, but they are used less often.

Making changes

Treat the current SVN repository as a sandbox. Once we all get used to the tools, we'll start from scratch doing only serious changes.

jhusak: how about using a branch for the sandbox and do serious work in trunk?

The easiest change is modifying a file which is already in SVN. Modify the file as you normally do - e.g. edit text files in the notepad. Next choose SVN Commit - it will display the list of modified files. Enter the description of the change in the top edit box (the description is important so that it's easier to browse the history), accept. Enter your SVN login and password. Our changes are sent to the server and are available for the others, who need to do SVN Update.

To add a file, put it in the directory, right-click it and select TortoiseSVN / Add. The file won't be sent to the server until you select SVN Commit, as described above.

To delete a file don't just delete it. Instead, TortoiseSVN / Delete, then SVN Commit.

To rename a file, TortoiseSVN / Rename, then SVN Commit.

To copy or move a file, drag it with the right button - a menu will appear with options to copy, move and optionally rename. Then SVN Commit.

Only SVN Commit sends our changes to the server. The other operations work locally on our computer.

I think that's enough for the beginning. Any questions?

Viewing changes

Install TortoiseSvnDiff. It's optional, but strongly recommended.