Personal tools

Revision Control Server

This page describes how to gain access to a shared repository (either Mercurial (HG) or Subversion (SVN)) for your project. It doesn't attempt to document how to use either system, nor help you choose which to use. We suggest you look at the relevant documentation on the above-linked websites, if you are not already familiar with either system.

Initial Setup: Creating an SSH key

  1. The first step is to create an SSH key (if you already have a suitable key, you can skip this step). I suggest reading the ssh-keygen manpage, but if you are lazy, don't care about security, and just want to create a new key without a passphrase, run:
    $ ssh-keygen
    ...and press enter at the prompts.
  2. Email Andrew your new public key, eg:
    $ mail -s "My public key for Advanced OS" andrewb@inf.ethz.ch < ~/.ssh/id_rsa.pub
  3. Wait for Andrew to add your key to the relevant group account, so you can login.

If you are working in the student labs

If you are working in the student labs, and your home directory is on DFS (which is highly likely), you have an annoying problem: DFS doesn't track UNIX file permissions, but ssh checks these and refuses to use your private key file because it thinks it is insecure. We have written a small wrapper script for ssh that copies your private key to a local filesystem with the correct permissions before invoking ssh, but you will need to configure Mercurial or Subversion to use this script instead of calling ssh directly.

For Mercurial, edit (or create) ~/.hgrc so that in the [ui] section, you have:

[ui]
ssh = aos_ssh_wrapper

For Subversion, edit ~/.subversion/config so that in the [tunnels] section, you have:

[tunnels]
ssh = aos_ssh_wrapper

Feel free to have a look at the wrapper script if you want to see what it is doing.

Configuring your client

Mercurial

The repository URL you need to use is ssh://aos_grpX@hg.systems.ethz.ch/, where X is your (lower-cased) group ID. For example, to push the committed changes in your local working repository to the shared repository if you are in group Z, do:

$ cd path/to/aos_project
$ hg push ssh://aos_grpz@hg.systems.ethz.ch/

To make this the default destination for push and pull operations (probably a good idea), edit the .hg/hgrc file in your working repository so that it has:

[paths]
default = ssh://aos_grpz@hg.systems.ethz.ch/

Subversion

The repository URL you need is svn+ssh://aos_grpX@hg.systems.ethz.ch/, where X is your (lower-cased) group ID. For example, to import your working directory to your subversion repository if you are in group Z, do:

$ cd path/to/aos_project
$ mv .hg ../dothg_temp # SEE BELOW
$ svn import svn+ssh://aos_grpz@hg.systems.ethz.ch/
$ mv ../dothg_temp .hg # SEE BELOW

... the reason for moving .hg out of the way is to prevent its import into subversion (it contains Mercurial's own revision control information, and is very large). If you are sure you will never want to use Mercurial again, you could just remove the .hg directory instead of moving it aside for the import.

Then, to check out a new working copy of whatever you just imported, do:

$ cd ..
$ mv aos_project aos_project.old
$ svn checkout svn+ssh://aos_grpz@hg.systems.ethz.ch/@HEAD aos_project
Document Actions