Background:
We've
been using Subversion for source control on our extensive ASP.NET
project for the last year. It was the fourth tool we tried, and the one that
stuck. We have an automated build process and a distributed team. Our
repository resides in Minnesota and we have developers in Florida.
We
started about 18 months ago with Visual Source Safe, and poor WAN
performance led us to try Source
OffSite as well as SCCBridge.
SOS worked well, but I wanted to investigate free alternatives.
SCCBridge was free and looked promising, but I could not get it to
work with our server.
We then installed a demo of SourceGear's
Vault. I
liked the fact that it had a SQL back end. Performance was better
that SOS (slightly), but we had a problem with sessions timing out.
If you've never seen it, check out their movie
trailer.
I've was also evaluating TargetProcess
at the time and their road map included integration with Subversion.
(I think it was originally slated for November 2005, it's now planned
for January 2007). When the demo for Vault was about to expire, and
after reflecting on the minor problems, I decided to to install
Subversion.
About Subversion Clients:
The
trick with Subversion is that there are multiple clients available
and you'll need to find the client that is the best fit.
At first
we choose two: TortoiseSVN
and AnkhSVN.
Tortoise
seems to be the overall favorite of the community. It integrates into
Windows Explorer. At first, I found this a bit strange, but I quickly
got used to it. It provides a rich interface as well as diff/merge
tools and frequent updates
Ankh is a plugin for VS.NET. It
does not use the SCC API, so I avoided it at first. (Not using the
API means that VS.NET doesn't know that the files are under source
control.) I did try SVN
SCC Proxy, a commercial client that uses the API, but it has
special needs. I have decided that I did no mind VS.NET being
ignorant about the source control, if you've ever dealt with the
Change Source Control dialog box you'll probably agree.
(Note: I was still using 2003 at this time.)
I stopped using AnkhSVN after Visual
Studio 2005 came out because of compatibility problems, however their
sites says that the current release is compatible. Tortoise meets
most of my needs. The biggest inconvenience is that when adding new
files to your solution\project you have to remember to add them to
source control manually. (This could be a big hassle depending on how you
work.)
Alternatively, there's a new player on
the field, VisualSVN,
moderately priced at $19 and integrating with Visual Studio, it looks
very promising. However, it is still new and is not yet full
featured. Keep an eye on it though.
Of
Special Note:
I'm not going to walk through the
entire setup process, but rather point out a few caveats. I do
recommend not being lazy; read through the manual that comes
with Subversion. (The product is different enough from the
VSS/SourceGear model to be confusing.)
The most important
thing to note is the standard Subversion client (and hence all the
third party clients) used a hidden directory to store metadata about
files under source control. The directory is labelled .svn.
This
chokes an ASP.NET application. Well, it did with 1.1, I haven't
tested it with 2.0.
Tortoise provides a special option during
their install to use _svn instead. Likewise, Ankh
provides a configuration that allows you to specify the directory
name. Do not use Ankh to add anything to a repository until you have
modified the config file to use _svn.
Subversion uses a
Copy-Modify-Merge model. I was used to the CheckOut-Modify-CheckIn
model and did not want to try CMM. However, after a week of use, I
don't think that I will go back. It is very nice to be able to work
when I don't have an Internet connection to my repository.
If
you're used to VSS, get acquainted with the difference of vocabulary.
Here's a quick cheat sheet:
Check Out - Get an
initial working copy. Only used when you're setting up things on your
dev client.
Export - Get a clean copy of the
project. This means that the local copy with not be under source
control.
Update - Get the latest version. This
merges changes from the repository into your working copy. It also
merges changes into files you've modified, but does not remove your
modifications.
Commit - Sends your modifications
to the repository.
Finally, be cautious when it comes to
renaming, deleting, or moving files. You will want to use the
commands provided by your chosen SVN client. Using the native
functions or doing things outside of VS.NET can lead to
inconsistencies.
PS
During our Subversion setup something
caused a problem with Internet Explorer. New Windows would not open
properly. Here is an easy
fix.
I also recently found msbuild integration for Subversion at http://msbuildtasks.tigris.org/. However, I was "integrating" previously using .bat files.