Subversion (SVN) is a source code management system similar to CVS, but nicer in many ways. It assistes with collaborative development, and can be useful even for single-developer projects where code may be modified on different computers.

Basic Use in Visual Studio

To get started using Subversion:

  1. You will need to E-mail bugzilla and ask them to grant your CPSC account permission to access the SVN repository for the ILab.
  2. Download a program to interface with the SVN repository. We recommend AnkhSVN, which integrates nicely with the Visual Studio 2005/2008 IDE.

For reference, the ILab SVN repository URL is as follows:

To create a new Solution and SVN Project:

  1. When creating your project, check the "Add to Subversion" option.
  2. (Additional instructions?)

To create a new SVN project from an existing Solution:

  1. Open the Solution that you would like to put under version control.
  2. In the Solution Explorer, right click the Solution node and choose "Add Solution to Subversion..."
  3. The project name will already be filled in for you from the Solution name. Change this if you like.
  4. Copy and Paste the repository URL into the "Repository Url" dropdown.
  5. Check the "Add Trunk" option. (???)
  6. Click OK. This will refresh the tree view beneath the Repository URL box.
  7. You may wish to create a folder for yourself off the "svn/research/ilab" root node. If not, just select the root node. Click OK again.
  8. A dialog will come up where you can type in a log message. Maybe just type something in to the effect that this is your initial check in for the project. Click OK.
  9. The "Pending Changes" window will appear in the Visual Studio IDE window where you can select which items you wish to commit. You can muck around with this if you feel the need.
  10. Click the "Commit" button and wait for the process to complete.
  11. Congrats, your Solution is now under version control!

To check out an existing SVN project:

  1. Start Visual Studio
  2. Select File > Subversion > Open from Subversion
  3. If the URL for your Subversion repository does not appear in the URL dropdown, then click the Add URL button beside it and type in the desired respository URL. You will be prompted for your username and password.
  4. Browse to find the .SLN file of the desired solution you would like to check out. Select it and press the Open button. The "Open Project from Subversion" window appears.
  5. In most cases you want the Type to be Latest Version. In the Local Directory group box, you can select where you want the files to go on your local machine. If you don't like the automatic suggestion, you can browse for a different location.
  6. Click OK and wait for the project to download. The Solution will be opened and ready for you to stark working with it!

To commit changes to your project:

  1. Use the Commit button in the Pending Changes tool window, or right click on your solution and choose Solution File > Commit...
  2. Wait for the operation to complete.

To obtain the latest version of your project:

  1. Use the Update button in the Pending Changes tool window, or right click on your solution and choose Update to Latest Version
  2. Wait for the operation to complete.

Mixing Projects from Different SVN Repositories

You may wish to create your own solution which brings in one or more projects from a separate SVN solution. Furthermore, you may wish to put your own solution under version control. Luckily this works quite nicely because Visual Studio knows which projects belong to which SVN repositories. So if you add your solution to its own SVN repository, it will NOT include the sub-projects that are already under version control from other solutions. Furthermore, if you modify the projects from other repositories, your changes will automatically be committed to those subsequent repositories when you commit your solution.