Swarthmore College Department of Computer Science

subversion repositories and trac

The Computer Science department has the option of creating svn repositories that also allow the use of the trac web interface for managing the repository. For those of you that don't know, svn (or subversion), is a version control system. This means that if you use the svn repository system, it will store changes you have made to your projects. If you make a mistake, or delete a large section of code by accident, you can easily revert to a previous version. Trac is an interface that allows easy viewing of source code, previous revisions, revision differences, and a ticket creation system. You can read more about svn and trac here:

requesting a repository

In order to begin using svn and trac, you first have to request a repository from your friendly local system administrators. You can do this by catching one of us and asking in person, or you can send us an e-mail at local-staff. Either, way, we will need to know several things:

  • The username you want for your svn repository. This need not be the same as your cs username.
  • The password you want for that username. If you're sending us an e-mail, we can assign you a default password and we can change it later. If you ask one of us in person, you can type the password in at the creation of the repository.
  • Whether or not you want trac enabled. Trac also has user names and passwords, and they will be the same as the svn usernames and passwords.
  • If you want trac enabled, there is a set of permissions for an anonymous user. By default, the anonymous user has no permissions whatsoever, to prevent copying of homework source code. If you want the anonymous user to have permissions, tell us what permissions they should have. The list of available trac permissions is here: Trac Permissions.

using svn

Svn is a version control system, and as such, has standard version control system features. We recommend you read about these features in more depth (at the svn website listed above), if the following explanations are not clear.

  • All svn commands will prompt you for your username and password. This will default to your cs username. If your cs and svn usernames differ, hit enter once, and it will prompt you to enter a username. You can then enter your password.
  • After your repository is created, you will need to check out a working copy (even though you haven't added anything to it yet) to begin editing it. You do this with the svn co command:
    svn co http://svn.cs.swarthmore.edu/svn/nameofrepos
    
  • To add files to the repository, which you must do every time you create a new file, use the svn add command (while in the working copy):
    svn add filename
    
  • Removing is the same as adding, except with the command svn remove instead of add.
  • To commit changes, file adds, and file removes, use the svn commit command. This command will automatically bring up your favorite text editor, asking you to input a message. If you want to put in a message on the command line, use:
    svn commit -m "message in quotes"
    
  • To update your working copy, run svn update
  • To see the differences between your working copy and the repository, run svn diff (or svn diff filename to see just a single file's diffs)

Here are some svn reference cards that might be useful: subversion-cheat-sheet
svn-refcard.pdf

And here's a nice page that shows how svn is used: svn Basic Work Cycle

using trac

The CS Trac repositories are listed here. To view and make changes, you will probably have to log in using the link in the upper right hand corner. The username and password will be identical to the svn usernames and passwords.

possible errors

If you see the error on the first two lines below when trying to checkout, subversion might be confused about what your username is (this warning is especially valid if you have a previous repository). Try running the check out command on the last line (i.e., try specifying your username).

svn: PROPFIND request failed on '/svn/repo'
svn: PROPFIND of '/svn/repo': 403 Forbidden (http://svn.cs.swarthmore.edu)
svn co --username your_uname http://svn.cs.swarthmore.edu/svn/repo

If you get a gnome keyring dialog box asking for a password, add this to your ~/.subversion/config file:


[auth]
password-stores=