|  About Me  |  Blogs  |  Photos  |  Publications  |  Resume  | 

Installing Subversion - a compelling replacement for CVS

In the aftermath of data loss, looked into subversion, which is rated as the top
newcomer of the year, according to linux-magazine. It aims to be a
better CVS where it versions not only file contents and file existence,
but also directories, copies, and renames.

It has a nice clean syntax and tries to have a similar interface as
cvs, but avoids all the messiness of restructuring the directories
under CVS. Most of the commands are recursive, so you can create the
directory structure first, then commit all together.

I apt-get subversion and it’s setup as follows:

Create repository

To created a repository:

$ svnadmin create /var/lib/svn

create initial project repository:

$ svn mkdir -m "Initial roots" \
    file:///var/lib/svn/www \
    file:///var/lib/svn/config

import projects:

$ svn import notes file:///var/lib/svn/notes

Work with checkout copy

$ svn co file:///var/lib/svn work
creates a directory work with projects inside

make changes

$ svn update
$ svn mkdir
$ svn add
$ svn delete
$ svn copy
$ svn move

examine changes

$ svn -R list /path/to/repository
	- to check the files in repository without downloading
$ svn status
$ svn diff -r x:y file
$ svn cat [-r x] file
$ svn log [-r x:y] file
$ svn revert

conflicts

when file conflicts, there 3 extra files:

filename.mine
file you were working with
filename.rOLDREV
base revision
filename.rNEWREV
new revision

once you’ve edited the file to merge conflicts manually:

$ svn resolved
$ svn commit

Admin tools

$ svnadmin dump
dumps content of repository
$ svnadmin load
load a repository from dump
$ svnadmin hotcopy
makes a hot copy of repository
$ svnshell.py /path/to/repos
browse source tree

Configure remote access with svnserve

Subversion can use Apache or svnserve to allow remote access. I picked
svnserve because it’s simpler to setup and I can use existing ssh
accounts.

uses system user accounts so need to setup user permission:

$ cd /var/lib
$ addgroup svn
$ chown -R root:svn svn
$ adduser anniec svn
$ chmod -R 775 svn

now to checkout from remote computer:

$ svn co svn+ssh://anniec@anniec.no-ip.com/var/lib/svn work

works!

Plugins

svn also has a few tools and plugins, for example
it has eclipse plugins,
GTK GUI client, it even has a very nicely integrated windows shell extension for windows - toroisesvn - so you can right click for update, commits, diffs etc.

Leave a Reply

You must be logged in to post a comment.