Short SVN Introduction

This was written by Martin Ehkme for our ohtu project propipe,
and can be found here
I have changed it to describe our current project.

SVN Home Page

The repository is already in place at

/home/groups/ais06g10/subversion

No manual changes to this directory (via filesystem)!! By using the svn command you might do almost anything.
You always work on a working copy.

Checkout

To get one working copy, go to your own home directory and type:
svn co file:///home/group/ais06g10/subversion roomba
co is a shortcut for checkout. It exports all files of our project from the repository. This is done only the first time or when you have no files there, yet.
This only works in the departments, from where you direct access to the department's filesystem. From outside the department you have access via ssh. From a unix-console type:
svn co svn+ssh://cbjorksk@melkki.cs.helsinki.fi/home/group/ais06g10/subversion roomba
This tells svn to login by ssh and do somehow the checkout. Replace "cbjorksk" by your own login. It will ask for your password, unless you have installed public-key authentication for your ssh login.
After you have done the first checkout, you do not need to include anymore the path to the repository for the following commands (it is stored somewhere in the .svn directory in your local copy).

Update

Before you start working on something, you always run an update. This makes sure, that your local copy gets all changes done since your last update. This requires however an previously checked out working copy.
Go below the propipe directory of your local copy and type:
svn up
This affects only the files in the current path and below. If you for instance go to the propipe/doc directory and make an update, only the doc directory and its files will move to the newest revision.
You probably have already noticed, that svn always says something about a revision. This is like the commit-number. It allows you also to easily revert files to an earlier number. If you want to see for instance, how the first version of test.txt looked like, go to propipe/doc and type:
svn up test.txt -r 1
This reverts this file to the first revision.

Commit

No it's time to change something. Edit test.txt and type
svn ci -m "MESSAGE"
Replace MESSAGE by a short description about your changes.
If there was an error message, probably a conlict occured. This will happen to everyone of us earlier or later and just means, that someone modified the same file at the same time, but checked in earlier. So your local copy became old, while you were making your changes.
In this case you have first to do an UPDATE again. Then try to COMMIT again and svn will tell you, if and where there are conflicts.
For conflict resolving please read: http://svnbook.red-bean.com/nightly/en/svn.tour.cycle.html#svn.tour.cycle.resolve
This is a short part of the SVN-book and explains conflict solving very nicely.
Basically you have somehow to put the stuff between the conflict markers "<<<<", "====" and ">>>>" together, but in a way, which does not break the whole thing. If you get confused, you always have the .mine, .r?, .r?+1 files... (just read the part of the book).
After that, you run
svn resolved CONFLICTINGFILE
and a COMMIT on that file

Add

You might also want to create new files. When you have created a new file or directory, which you want to be included in the version controlling, the files first have to be in a proper place in your SVN working copy. Then run
svn add PATHORNEWFILES
This adds these files to version control, but does not commit them. Thus you have to run a COMMIT afterwards.

Additional notes

Above are the most import features. Others which can be interesting could be e.g. svn diff, svn delete
The SVN-Book has also some section, which describe the subcommands: SVN-Book