2005-10-31 · in Tech Notes · 407 words

This is a (very) rough guide to Subversion for Kent students. Before jumping straight into Subversion (or CVS, for that matter), I would recommend that you have a look at the more modern distributed version control systems, particularly if you're a team of students working independently or have intermittent Internet access.

I don't recommend Subversion because it's significantly less flexible than the modern distributed version control systems, and maintains several of the disadvantages of CVS (no disconnected operation, no private branches, repositories can't be published without a special server) while still being different enough from CVS that a significant amount of relearning is required.

If you're going to learn a new version control system, then I think it's worth looking at some of the distributed systems, and seeing whether they'd fit your development model better. I use Darcs for several of the projects I'm involved with; Git is also popular.

Subversion does have advantages, though: in particular, there are more external tools that work with Subversion.

Using Subversion

Here's how to set up a Subversion repository on raptor and access it remotely. Before doing this, though, ask the cs-sysadmins whether you can use CSProjects for your project (which'll give you ready-made Subversion and Trac instances, and generally save you a lot of work).

As with CVS, there's a good online reference book available: Version Control with Subversion.

The Subversion version control system has gone through a number of revisions: there are several types of repository and several different ways of accessing them. You want an fsfs repository (since it's not backed by a database, and works over NFS storage) and you'll be accessing it using the svnserve method (since that doesn't require setting up a webserver, which you couldn't do on raptor anyway).

Suppose you want to put a Subversion repository in /usr/local/proj/myproject/project. To create the repository, you'd ssh into raptor and type:

svnadmin create --fs-type fsfs /usr/local/proj/myproject/project

To access the repository, the corresponding URL will be svn+ssh://ats1@raptor.kent.ac.uk/usr/local/proj/myproject/project. (Don't forget to use your own username rather than ats1 there; again, you will probably want to set up an SSH key to avoid typing your password several times for each access.) You can check it out using:

svn co svn+ssh://ats1@raptor.kent.ac.uk/usr/local/proj/myproject/project

... which'll result in an empty directory called project (because you haven't added any files yet). If you change into that directory you'll then be able to use regular svn commands to update, add files, commit, and so on.