posted on Tuesday, September 21, 2004 10:35 AM by mlorengo

Subverted! Setting Up Subversion

I decided to install two source code control providers so that I can begin putting my project under source code control. My initial choices for evaluation were going to be CVS, Subversion and Source Safe, after looking at Subversion, I see no reason to try and install CVS since it's more or less compatible with CVS with some added functionality. Here is an interesting comparison of source control providers. Granted it doesn't include comparisons with SourceGear's products or PVCS.

Eric Sink has written on online book on Source Control: How To

Installing Subversion

Subversion is billed as a better version of CVS. I chose to download release 1.1.0rc3 because according to the release notes it allows the repository to be file system based as opposed to using BerkelyDB. The release I'm downloading is for Win32 and is packaged as a setup program, and basically it runs the install and that's it.

I'm also installing TortoiseSVN which presents a nice GUI interface (similar to TortoiseCVS for CVS) into Subversion. I'm installing version 1.1.0rc2, here are the release notes.

Configuring Subversion

The Subversion Book is an excellent free resource for determining how to use Subversion. In addition Mike Mason advocates setting up a Single Repository over Multiple Repositories in subversion and also lists some suggestions for Effective Source Control

Creating A Repository

I'll use the command line tool to create a repository. I'll want to create the repository using the file system rather using the BerkeleyDB structure. This will allow me to access the file system remotely.

D:\>svnadmin create svn -fs-type fsfs

Adding to the Repository

After creating a repository in the d:\svn folder, I'm going to create a tmpdir and establish a folder layout for my new project. I could use the svn mkdir command if I wanted to, but since I'll be adding a few directories I'll use the svn import command.

D:\>mkdir tmpdir
D:\>cd tmpdir
D:\tmpdir>mkdir VirtualCellar\trunk
D:\tmpdir>mkdir VirtualCellar\branches
D:\tmpdir>mkdir VirtualCellar\releases
D:\tmpdir>svn import -m "Initial Layout of VirtualCellar Project" file:///d:/svn

Adding         VirtualCellar
Adding         VirtualCellar\releases
Adding         VirtualCellar\trunk
Adding         VirtualCellar\branches

Committed revision 1.
 

I'll now go ahead and delete the tmpdir and list the files in the repository using the svn list command

D:\tmpdir>cd ..
D:\>rmdir /s tmpdir
D:\>svn list -v file:///d:/svn
      1 mlorengo            Sep 21 12:17 VirtualCellar/

Checking out the project

Now that I have a project in svn, I'll go ahead and checkout the trunk to perform some work like adding my intial RUP documentation to the repository, but before I do that I'll use the svn mkdir command to make a Doc\rup folder under the trunk where my Inception and Elaboration documents will reside.

D:\>svn checkout file:///d:/svn/VirtualCellar/trunk VirtualCellar
Checked out revision 1.
D:\>cd VirtualCellar
D:\VirtualCellar>svn mkdir Doc
A	Doc

D:\VirtualCellar>cd doc
D:\VirtualCellar\Doc>svn mkdir rup
A	rup

D:\VirtualCellar\Doc>cd rup
D:\VirtualCellar\Doc\rup>mkdir 01Inception
A	01Inception

D:\VirtualCellar\Doc\rup>mkdir 02Elaboration
A	01Elaboration

D:\VirtualCellar\Doc\rup>cd 01Inception
D:\VirtualCellar\Doc\rup\01Inception>

Now that I have my directory structure built, I'll go ahead and commit the changes queued thus far

D:\VirtualCellar\Doc\rup\01Inception>svn commit -m "Added rup documentation folders"

Now I can copy my BusinessCase.Doc and my Vision.Doc documents to the 01Inception folder and add them to the repository

D:\VirtualCellar\Doc\rup\01Inception>svn add Vision.Doc
D:\VirtualCellar\Doc\rup\01Inception>svn add BusinessCase.Doc
D:\VirtualCellar\Doc\rup\01Inception>svn commit -m "Added Inception Documents to repository"

What's Left To Do

Now that I have Subversion setup, there are still a few more things left to do. I'll need to work out security, so I know who's checking in what, and I'll need to figure out the svnserve -d option so that I can pull information from the repository remotely.

I know I promised some Use Cases and User Stories today, but it appears that those tasks have been subverted (ouch!). I'll work on them the rest of the day and maybe get them posted later on this evening.

Comments