Visual Studio and Subversion
Submitted by Adam Oellermann on Tue, 2006-10-03 13:17. .NET | C# | SubversionI'm working on a Sharepoint project which has some interesting points:Â
- We're constrained to use Visual Studio .NET 2003 by the client (so none of your Team System stuff)
- We have 3 developers, on three sites, plus a client developer on a fourth and fifth site
 It's a biggish project, and the thought of trying to run Visual SourceSafe under these circumstances frightened me. I've seen that thing "working" over a VPN, and it ain't pretty. What to do?
Well, if you subscribe to Eric Raymond's taxonomy, we're a "cathedral" sort of company. Microsoft gold partner, well-defined methodology, coding standards and all that. But clearly the working environment smacks somewhat of the "bazaar" (please: no jokes about it being "bizarre" - they are far too close to the bone), and I figured at the outset that it was time to take a serious look at incorporating at least some "bazaar" techniques into our "cathedral" framework. Open-source projects successfully manage hundreds of developers, on hundreds of sites: how do they do it? By subversion (well, perhaps also by CVS and others, but this article is about subversion). I don't mean that they sneakily and deviously implement their software, I mean that they use subversion as a source code/version control system.
 So I decided to give Subversion a go. Now, I've been developing for a little while now (since 1987, by my reckoning), but somehow have managed to never really use a copy-modify-merge system in anger (that's right, I've hithertofore been a good little lock-modify-unlock sort of developer, or sometimes on small personal projects, a seat-of-the-pants-oops-I-broke-it sort of developer). Anyway, the copy-modify-merge thing beckoned: it was the right implementation for the structure/locations of our team. Subversion was chosen because it has a cool name, is in use by some very respected projects, has all the nice distributed features I wanted, and is free (beer & speech).Â
SPOILER: Adam, the hero of the story, gets Subversion up and running with minimum fuss.
Here's how I went about it:
- Learn about Subversion - I read most of "Version Control with Subversion " by Ben Collins-Sussman, Brian W. Fitzpatrick and C. Michael Pilato, a free book (free HTML and PDF versions under the Creative Commons Attribution License, or buy the O'Reilly hardcopy). If you want to use Subversion but are a little uncertain about how to set about it, go right now and download or order this book. It is clearly written and provides a lucid introduction to Subversion's architecture, approach and fundamentals of administering and using Subversion. I inhaled most of the book before even approaching the keyboard.
- Install Subversion - on the server I was using, this involved going "apt-get install subversion" and "apt-get install libapache2-svn" Clue: that's not Windows. You can run Subversion on Windows, but I thought I could save myself some trouble by setting it up on a Linux box - after all, Subversion's provenance is quite Unix-flavoured.
- Created the repositories - "svnadmin create /home/repositories/<projectname>"
- Ensure that DAV and svn modules are enabled - "a2enmod dav" and "a2enmod dav_svn"
- Created a password access file using htaccess2 in the usual way
- Edited /etc/apache2/mods-available/dav_svn.conf to make my repository available via SSL
Thwok! Just like that, Subversion was up-and-running. Next up was accessing it from development machines. We use three methods:
- Just create an entry for the repository in "My Network Places" in Windows Explorer; works sweetly if you need to grab a copy of the source and there is nothing installed on your client machine
- Use the Windows Subversion binaries for command line "svn commit" etc
- Use TortoiseSVN to provide Windows Explorer-integrated Subversion - this is truly, truly slick.
There is a VS.NET plugin called AnkhSVN, but I haven't tried it yet as TortoiseSVN does everything we want.
 After all that, it's up and running, we are working efficiently and well across sites. It seems too good to be true. Congratulations to everyone involved in the development of Subversion and TortoiseSVN; you have my gratitude and admiration. This early success has left me brimming with ideas (perhaps not ready to keep "my life in Subversion", yet, but the idea no longer seems so alien). Perhaps the charm will wear off as our project wears on; I will update you on any further developments.