Subversion (SVN) Repository for Assignments

You need a CS account to be able to access the repository. If you do not have a CS account contact me as soon as possible.

You will be given your own Subversion repositories to do your assignments. Each of you will have read and write access to your own repository, but to no one else's. The access is enforced with Linux Access Control Lists (ACLs). You will use your CS login ID and password to authenticate.

If you are not familiar with Subversion (also often called SVN), refer to the online Subversion book. If you have used any other version control system before (especially CVS) you will find it fairly easy to use SVN. If not, it is worth spending some time learning about version control systems and the SVN book does a fine job of introducing the basic concepts.

One-time Setup

A repository named after your login ID has been created for you. The first step is to “checkout” the repository. Suppose that your login ID is myid.

$ svn checkout svn+ssh://myid@hagar.cs.indiana.edu/u/achauhan/SVN/Teaching/B629/2007-Fall/myid

This will create a directory called myid in the current directory where you issue the above command. To begin with the directory is empty. You will create subdirectories to do your assignments. You will not have to write the above long URL during the routine use of the repository after the initial setup. You are free to use any CS Linux server, in addition to hagar, to access the repository as long as the above directory is visible on that server. Using a non-Linux server is not guaranteed to work.

Doing your Assignment

Since your future assignments will build on the earlier assignments it makes sense to keep your work in a single directory. A directory called trunk has been created in your repository. Please do all your work in that directory. When submitting an assignment, create a snapshot (tag) of the trunk directory. For submitting assignment number n:

$ cd myid
$ svn cp trunk An
$ svn commit -m 'Submitting assignment 1.'

The -m option specifies a log message. If you do not use that option, svn will open a text editor for you to enter the message. You can choose the text editor by setting the environment variable SVN_EDITOR.

Each time you create a new directory or file that you want in the repository you will need to add it using the svn add command. This needs to be done only once for each file or directory. Each time you do a commit the current revision number advances by 1.

Course Support

You may also checkout the Support directory, which is outside your working area.

$ svn checkout svn+ssh://myid@hagar.cs.indiana.edu/u/achauhan/SVN/Teaching/B629/2007-Fall/Support

The Support directory will contain any code that might be supplied to you to get started on an assignment. If needed, it will be updated when a new assignment is announced. In order to use the code copy the support code to your assignment directory. Do not try to compile and use it from within the Support directory directly. You do not have write access to it, and any modifications you make there will be unavailable to the grader. When you copy, make sure that you do not end up copying the .svn directory. One way to do that is using tar. Suppose that you want to copy the support code for Assignment An. Also, suppose that you checked out the Support directory at the same level as your course working copy myid.

$ cd trunk
$ tar --directory ../../Support/An . --exclude .svn -cvf - | tar xf -

This will populate your trunk directory with the supplied code. The Support directory is organized the same way that you are supposed to organize yours—the trunk contains all the support code and directory An is just a copy (tag) of the support supplied for assignment n.

General Remarks

B629, Arun Chauhan, Department of Computer Science, Indiana University