The Layout of a Subversion Repository

The Layout of a Subversion Repository

Published on: Saturday, April 4, 2009 1:07:00 PM)

In and amongst other things recently, I've been working on sorting out a replacement for Microsoft SourceSafe / nothing at all. I've done my research and I believe Subversion an excellent starting place for using version control and will probably keep most, if not all developers happy. If distributed (and GIT) turns out to be too much of an advantage to ignore - the fact that Subversion is such a mature and well used product, there will always be an upgrade path.

I'll try not to go into too much detail, as there are plenty of useful resources dotted around that you can find information from. However, before I go onto the directory layout of our repository, I feel I should mention the hardware and software layout of Subversion itself in our environment. Where I work, we are migrating from our historically used Classic ASP code to using C# in ASP.NET, though we have some systems using PHP too. I mention this because we want to be able to use Subversion to look after all code - not just one specific language.

Server Software: In my opinion, I believe you need both Subversion and Apache HTTP for an optimal setup. As we have an Active Directory server as well, it seemed like a good idea to use this rather than create further usernames and passwords for all our developers. For this, you can download and configure everything manually (after all, there is an excellent resource in the free eBook on Subversion) - but actually - you might as well just download the excellent VisualSVN Server. It takes almost all the hardwork out of creating the Subversion server. It's truely a brilliant piece of kit and if you are new to Subversion, I'd advise using this (or at least having a nosey at it and seeing how it does things - if you're that way inclined). It's possibly worth me mentioning that all these applications have the most agreeable price-tag of absolutely nothing at all. Woo!

Client Software: For this, every developer wanting to use Subversion must install TortoiseSVN. TortoiseSVN is a great explorer based client for Subversion that allows developers to perform standard (and advanced) commands from the safety of the right click context menus. This works for all languages and files, but I'd advise for anyone working in Visual Studio, that downloading and paying $50 for VisualSVN is money well spent. It doesn't require VisualSVN Server, but it gives you a way of utilising all the TortoiseSVN context menus from within Visual Studio, meaning you needn't worry about mulitple windows and all that. Just concentrate on your coding! Also, because you have installed VisualSVN (or Apache seperately) you can allow (authenticated) users to view the repository in their web browser of choice.

All this and we're almost up and running. But before we can continue, we need to sort out the structure. This is how I've suggested our team uses it:

svn / aspnet  / libraries  / trunk
                           / branches
                           / tags
              / project01  / trunk
                           / branches
                           / tags
              / project02  / trunk
                           / branches
                           / tags
              / users      / amadiere
                           / user02

Basically speaking:

I think with this format, we've got a good standing point for where we want to be going with Version Control and the ASP.NET environment. I'm confident, but until we really start using it in anger - we'll never know! But the idea is then, when I want to develop something, I open Visual Studio and a blank solution. I then add the projects that I'll need (e.g. Project01, Libraries and Amadiere) and off I go - I have everything open I need and they are all going to their appropriate places in Subversion! Genius!