Quickstart Guide to Subversion on CDOT

Introduction

The following describes what is needed to access and use the Subversion repositories on Seneca's CDOT server. If you are new to Subversion or version control software, read on. If you are only interested in discovering the appropriate client settings, skip ahead to the final summary.

Subversion on CDOT

CDOT provides version control to the projects it hosts using Subversion (SVN). The CDOT server has Subversion 1.1.3 installed and configured. There are two main ways to setup Subversion. First, you can integrate Subversion with the Apache web server and use the WebDAV protocol to access Subversion Repositories over HTTP. The second method is to use a stand-alone server (svnserve) and custom Subversion protocol. Using this method users can access Subversion Repositories directly over a network or can tunnel through SSH. The second method is the one currently setup on CDOT.

The choice to use svnserve was made primarily on the basis that CDOT currently uses Apache version 1.3 and at least version 2.0 is required to integrate Subversion with Apache. At some point in the future CDOT will be upgraded, and at that time this configuration may change.

This configuration information is important to understand from a user's perspective because it determines how one connects to the server. In tutorials and other documentation for Subversion (see links here), it may be assumed that a server is configured in one of the methods described above.

Choose a Subversion Client

Before you can work with the CDOT Subversion server, you will need to install a Subversion client. There are many options available, ranging from pure command-line to elaborate GUI based. Your choice will also be influenced by the operating system you are planning to use, although it doesn't matter what you choose--Subversion works on Windows, Linux, Mac OS X, etc.

The most basic option is to download the command line client from the Subversion web site. Both the Windows and Linux command line clients work in the same way, so you might choose to start with this as a way of learning the system in a platform independent way. Refer to the instructions for your chosen download when installing.

You might also choose to use one of the GUI clients, such as Tortoise SVN for Windows, AnkhSVN for Visual Studio.NET, or eSVN on Linux. There are a dozen more GUI client options available on the Subversion Links page.

CDOT Repositories

Once you have installed a Subversion client application, you are ready to begin using and learning Subversion. At the most basic level you need to understand that Subversion uses Repositories to manage your files. These repositories are really just a database, configuration information, and other related files. Most of the time you don't need to understand much more about repositories, as they will be managed and administered on the server, not by the client.

Subversion servers can be setup to use one or more repositories. On some servers there will be a single repository with many sub-projects contained within. Other servers are setup to use multiple repositories as a way to isolate unrelated projects and their users. The latter option is how CDOT is setup.

On the CDOT server every project requiring version control gets its own repository. All CDOT repositories are located under:

/data/svn

If you were to examine this directory you would see a list of sub directories representing each of the projects currently under version control on CDOT. Even though you won't ever access the /data/svn directory manually, it is important to know that it is there, as some Subversion commands require an absolute path to a repository.

Connecting to CDOT Repositories

You can connect to a CDOT Subversion repository using a Subversion client, which will require a URL to the repository. The URL types are:

As was mentioned before you can NOT connect using HTTP and WebDAV due to the configuration of Subversion on CDOT.

Many users will not have CDOT shell accounts, but still require access to Subversion repositories. Subversion accounts will be created for these users, and they can access their repository using the following URL in their client program:

svn://cdot.senecac.on.ca/project_name

Users with shell accounts can use their existing CDOT accounts locally on CDOT:

file:///data/svn/project_name

or remotely by tunnelling through ssh:

svn+ssh://username@cdot.senecac.on.ca/data/svn/project_name

Notice that when using svn+ssh:// you must: a) give your username as part of the URL; b) use an absolute path to the project. With svn:// URLs you can simply give the project name.

Experimenting with the Sandbox Repository

If you are new to Subversion you will likely want to spend some time learning the commands, your client, and how version control works. To get you started a special repository has been created called sandbox. This repository is not part of a CDOT project, and the files it contains are of no significance. It was created in order that CDOT users could experiment with and learn Subversion. Users are free to do as they like with this repository so long as they: a) not intentionally destroy data; b) remember that this is a publicly available learning repository and not somewhere to put important or private data.

The sandbox repository is publicly available and gets automatically recreated on the server nightly. Therefore, you can safely use it to practice checking out files, committing changes, moving directories, etc.

Begin by checking out a working copy:

C:\temp\>svn checkout svn://cdot.senecac.on.ca/sandbox
A  sandbox\trunk
A  sandbox\trunk\dialog.c
A  sandbox\trunk\misc.h
A  sandbox\trunk\be_nossh.c
A  sandbox\trunk\putty.iss
A  sandbox\trunk\pproxy.c
...
A  sandbox\branches
A  sandbox\tags
Checked out revision 1.
	

You will not be prompted for a username or password, since this repository is publicly readable. However, when you attempt to commit changes back to the repository, you will need to supply a username and password:

C:\temp\sandbox\trunk>svn delete ssh.h
D         ssh.h	
C:\temp\sandbox\trunk>svn commit --username jsmith --password secret -m "Deleted ssh.h"
Deleting       trunk\ssh.h

Committed revision 2.
	

In order to commit changes to the sandbox repository you must provide a valid username and password. Three Subversion accounts have been created for the sandbox repository in order to allow you to practice committing changes. They are:

# username = password
[users]
jsmith = secret
smorris = secret
jcarson	= secret

Note that these are not shell accounts, and have no rights outside the sandbox repository. These accounts have been provided so that you can also experiment with multi-user repository access and learn to deal with situations like merging changes, conflicts, etc. For example, you can checkout and work with multiple working copies under different usernames on the same machine.

What to do now?

Subversion, and version control generally, will take some practice to get so you understand and feel comfortable with the key ideas. The best thing to do now is to begin reading Version Control with Subversion, which is freely available on-line. This is an excellent tutorial and reference for Subversion. Use the sandbox repository in conjunction with the tutorials and examples.

If you have questions or comments about Subversion on CDOT or this page, please email them to David Humphrey.

Summary