CUCC Expedition Handbook - Mercurial Quick

Quick Reminder - Mercurial

Version Control Software Reminders

This is NOT a tutorial. This is a set of reminders for people who already know all this stuff.

Since 2019 all use of version control software requires that you have cyptographic key exchnage already set up before any of this will work on your own machine.

You can, however, do all this on the expo laptop as this has already been configured with the right keys.

expoweb (The data management system)
hg clone ssh://expo@expo.survex.com/expoweb (read/write)
hg clone http://expo.survex.com/repositories/home/expo/expoweb/ (read-only checkout)
troggle (The data management system backend)
hg clone ssh://expo@expo.survex.com/troggle (read/write)
hg clone http://expo.survex.com/repositories/home/expo/troggle/ (read-only checkout)
loser (The survey data)
hg clone ssh://expo@expo.survex.com/loser (read/write)
hg clone http://expo.survex.com/repositories/home/expo/loser/ (read-only)
tunneldata (The Tunnel drawings)
hg clone ssh://expo@expo.survex.com/tunneldata (read/write)
hg clone http://expo.survex.com/repositories/home/expo/expoweb/ (read-only)

Using Mercurial/TortoiseHg in Windows

Read the instructions for setting up TortoiseHG in Tortoise-on-Windows. But this won't work at all until you set up the key exchange using PuTty/Pageant.

In Windows: install Mercurial and TortoiseHg of the relevant flavour from https://tortoisehg.bitbucket.io/ (ignoring antivirus/Windows warnings). This will install a submenu in your Programs menu)

To start cloning a repository: first create the folders you need for the repositories you are going to use, e.g. D:\CUCC-Expo\loser and D:\CUCC-Expo\expoweb. Then start TortoiseHg Workbench from your Programs menu, click File -> Clone repository, a dialogue box will appear. In the Source box type

What follows is for Linux. If you are running Windows then see below Using Mercurial/TortoiseHg in Windows.

Mercurial can be used from the command line, but if you prefer a GUI, TourtoiseHg is highly recommended on all OSes.

Linux: Install mercurial and tortoisehg-nautilus from synaptic, then restart nautilus nautilus -q. If it works, you'll be able to see the menus of tortoise within your Nautilus windows.

Once you've downloaded and installed a client, the first step is to create what is called a checkout of the data management system. This creates a copy on your machine which you can edit to your heart's content. The command to initially check out ('clone') the entire expo data management system is:

hg clone ssh://expo@expo.survex.com/expoweb

for subsequent updates

hg update

will generally do the trick.

In TortoiseHg, merely right-click on a folder you want to check out to, choose "Mercurial checkout," and enter

ssh://expo@expo.survex.com/expoweb

After you've made a change, commit it to you local copy with:

hg commit (you can specify filenames to be specific)

or right clicking on the folder and going to commit in TortoiseHg. Mercurial can't always work out who you are. If you see a message like "abort: no username supplied" it was probably not set up to deduce that from your environment. It's easiest to give it the info in a config file at ~/.hgrc (create it if it doesn't exist, or add these lines if it already does) containing something like

ssh://expo@expo.survex.com/expoweb

for expoweb (or similar for the other repositories). In the Destination box type whatever destination you want your local copies to live in on your laptop e.g. D:\CUCC-Expo\expoweb. Hit Clone, and it should hopefully prompt you for the usual beery password.

The first time you do this it will probably not work as it does not recognise the server. Fix this by running putty (downloading it from https://www.chiark.greenend.org.uk/~sgtatham/putty/), and connecting to the server 'expo@expo.survex.com' (on port 22). Confirm that this is the right server. If you succeed in getting a shell prompt then ssh connection are working and TortoiseHg should be able to clone the repo, and send changes back.