Subversion

From Maslab 2007

Jump to: navigation, search

Subversion is a version control system (like CVS, only without a decade of cruft). Its main advantage is the fact that it tracks changes to your source code base as a whole together, not to individual files.

Setting up a Subversion respository

  • To set up a Subversion repository for your team in your Athena locker:
    1. add svn (try to get this in your dotfiles)
    2. mkdir ~/maslab-repository (you can name it whatever you want)
    3. fs setacl -dir ~/maslab-repository -acl system:maslab-2006-team-N all (where N is your team number; see Athena lists)
    4. svnadmin create --pre-1.4-compatible ~/maslab-repository (make the repository)
    5. Make, somewhere unrelated in your home directory, a directory called maslab-project (or something); inside it place three directories called trunk, branches, and tags. Copy all of your code so far into the trunk folder.
    6. Change to the directory that contains the maslab-project directory. Type svn import maslab-project file:///mit/username/maslab-repository.
  • Follow the instructions below to check out your code somewhere.

The maslab-project directory was only to be used for initially importing the code into the repository; feel free to delete it once you're sure you can check out the code from it. (Don't delete maslab-repository!)

Using SVN

  • To check out a working copy of the project from your team's repository,
    1. If you are logged into your bot (as opposed to Athena), kinit username, type in your password, and then aklog.
    2. svn checkout file:///afs/athena/user/t/e/teammate/maslab-repository/trunk maslab-checked-out (where t and e are the first two letters the teammate who set up your repository). This will plop your project into the directory maslab-checked-out inside your current directory.
  • To update your (already checked out) archive: type svn update. This updates to the latest version in the repository, letting you know if you've made any incompatible changes locally.
  • To commit any changes you've made (in all files): svn commit.
  • To see what files have been changed: svn status (M means modified).
  • To add a new file to be version controlled: make the file like usual, then do svn add file.
  • To copy or rename a file: svn cp file1 file2 or svn mv file1 file2. (If you don't use svn here, it won't know that the file has moved!)
  • To get help: svn help or svn subcommand help.

Full documentation: The Subversion Book

Personal tools