Repository Templates are a great way to reduce the time required for setting up a new project, and encourage consistency across projects. Consistency is important especially in an organization with many different repositories spread over different projects and development teams. Having a consistent repository structure drastically reduces common errors made by new developers or even experienced developers in an unfamiliar repository.
Setting up Repository Templates in Sublime is as easy as creating a folder structure on your Sublime server containing the files and folders you want to include in your new project. In this walk-through we’re going to create a Repository Template for new projects using . Sharp Architecture is a perfect candidate for a Repository Template because there are quite a few dependencies that can take a while to download and organize.
In the following steps we’ll be creating a Repository Template for Sharp Architecture, but the same steps can be applied to any number of project types you may have.
The first step is to create the new Repository Template folder on your Sublime/Subversion server.

Create a new folder for the template

Create the branches, tags, and trunk folder

Create the project folder structure
Now that our basic structure has been created, it’s time to download the related Sharp Architecture binaries as well as their dependencies.

Copy Sharp Architecture binaries to template
The last step is to register the newly created Repository Template with Sublime.
[SharpArch]
name = Sharp Architecture
description = Use for Sharp Architecture based projects.

Insert new template description into templates.txt
C:\> iisresetOpen a web browser and navigate to Sublime. Click on the Create New Repository tab and in the Template section, you should see the new “Sharp Architecture” template.

Preview the new template
In this walkthrough we’ve created a new Repository template for projects using the Sharp Architecture framework. We created a folder structure and pre-downloaded all binaries and their dependencies so that new repositories would automatically have this structure and these resources. This same approach could be taken for any number of project types relevant to your organization.
Using these same techniques you could make your template more robust including common resources such as:
For additional information and complete documentation on creating Repository Templates, please see the Sublime documentation.
This article summarizes a few tips and tricks for working with Subversion from the Visual Studio IDE. Note that these tips assume that you are using TortoiseSVN as your SVN client. However, they should hold up whether you are using an SVN client integrated with Visual Studio or simply the command line.
One of the first things you should do with any new solution or project is to ignore the bin and obj folders that are automatically created when you compile your project. Here are the steps I follow when adding a new project to your solution:
These files pop up from time to time and you want to watch out for them. These files are specific to each user, so if they get committed, everyone will be continuously prompted to resolve conflicts because their version differs from the version in Subversion.
I’m going to catch a lot of flack for this one because it seems like a pain. But it’s really not that hard and it will help you avoid making multiple commits for a single change because .csproj or .sln files hadn’t been saved yet. For example, let’s say you add a new .cs file to your project. You code it up and are ready to commit. Switching over to TortoiseSVN you see your new .cs file needs to be committed, but nothing else. You commit that file and keep working. However, the .csproj file has been changed to, but it has only been changed in memory and not saved to disk so TortoiseSVN doesn’t see the change. You are now left in a position where only the new .cs file has been committed, and the .csproj file hasn’t. Ideally both files would be committed at the same time because together they represent the addition of your new .cs file.
My workflow is this:
This one is easy to overlook especially when it comes to ASP.NET projects. Subversion creates a hidden .svn folder inside each folder of your working directory. If your deployment “process” consists of copying your ASP.NET project folder and all sub folders (images, css, etc) and pasting them on your web server, you’re going to be copying all of those .svn folders along with it.
There are really two options to avoid this. The first is to use the “export” command from Subversion. If you are comfortable installing the Subversion command line client on your target server, then you can run a command like this to deploy your changes:
C:\> svn export svn://myserver/myrepo/trunk C:\inetpub\wwwroot\mywebsite
Once you have done that you’ll also need to copy over the DLLs because the bin folder won’t be included in the repository (assuming you followed tip #1).
A better solution is to use some sort of continuous integration or automated build process. Cruise Control.NET is a great solution for this sort of thing.
When moving to SVN from VSS there are really two different aspects to consider: technical, and social.
Technically, the answers are pretty straight forward. You need to decide where the SVN repositories will be hosted, how they will be served, and how permissions will be managed. You also need to decide whether or not you want to import your existing VSS repositories, and how much of the history you want to preserve. Finally, you need a client for your users – typically and optionally a Visual Studio plug-in like or .
The easiest ways to set up a SVN server is to use one of the pre-packaged installers like , Server, or . All of these will install Subversion and do a lot of the basic configuration for you.
Here are a few resources on the technical side:
Now, the social side may be a little more difficult. The biggest change is that VSS works with a check-out, edit, check-in model where SVN works with a edit, merge, commit model. This takes some getting used-to by the developers but ultimately it’s a better model in my opinion. With SVN, you essentially have the entire code-base checked out by everyone, all the time. You are free to make whatever changes you want without checking anything out. Then, when you are ready to commit your changes, you merge them with the latest version in the repository, and commit everything at once.
There are a few major benefits by taking this approach. One is that there are literally no roadblocks between a developer and the work he/she needs to do. I don’t need to wait for a file to be checked in, and if I want to make large changes I don’t need to worry about getting in anybody’s way.
The other major benefit is that each commit can represent a self-contained body of work: a feature, a bug fix, a unit test that passes, etc. All files and changes related to that body of work are contained within a single commit and it’s easy to look at the repo history and see why files were modified and how modifications relate to each-other. This is much harder to do in VSS because people usually check in file by file. Or, if they do check in multiple files at a time, it is probably because somebody else needs to edit one rather than them being finished with their particular feature.
Source control is an incredibly valuable tool for software development, but most people don’t think of it that way. Managed correctly, source control is a safety net giving developers an enormous amount of freedom to experiment, tinker, and implement with the knowledge that they can always go back if necessary.
In my opinion, you can’t do source control correctly with the check-out, edit, check-in approach. At least, not with a team of any significant size. So it’s worth some short term pain in terms of developer education for long term benefits.
has a on source control overall. In he discusses the differences between these two approaches.
It’s worth pointing out that SVN does support locking which lets you get close to the check-out, edit, check-in model typical of VSS. But, I’d still recommend biting the bullet and adopting the other model.