Back to Tutorials

Tortoise HG

Since there are so many good tutorials ( 1 2 3 4 ) on setting up mercurial archive access already, I thought I'd show how to set up TortoiseHG, a graphical interface to the archive. I completed this setup in Ubuntu, but it should be easily adaptable to Mac, and mostly similar to Windows.

Step 1: Install Mercurial and Tortoise HG

On Ubuntu, this is easy:

sam@ubuntu:~$ sudo apt-get install mercurial
sam@ubuntu:~$ sudo apt-add-repository ppa:tortoisehg-ppa/releases
sam@ubuntu:~$ sudo apt-get update
sam@ubuntu:~$ sudo apt-get install tortoisehg
sam@ubuntu:~$ thg

On a Mac and windows, you can download from here.

Step 2: Download the keys.

Download the keys from Neil and move them to a folder ~/.ssh.

sam@ubuntu:~$ mkdir .ssh
sam@ubuntu:~$ mv Downloads/classes* .ssh/
sam@ubuntu:~$ cd .ssh
sam@ubuntu:~/.ssh$ sudo chmod go-rw classes
[sudo] password for sam:
sam@ubuntu:~/.ssh$ gedit config

Edit the file to include the following.

host fab.cba.mit.edu
port 846

Step 3: Clone the archive

Tortoise has a utility for doing this, but I found it easier to manage the keys by doing it myself.

sam@ubuntu:~/mit$ mkdir 863.13
sam@ubuntu:~/mit$ hg clone -e "ssh -i ~/.ssh/classes" ssh://hg@fab.cba.mit.edu/863.13 863.13/
requesting all changes
adding changesets
adding manifests
adding file changes
added 62 changesets with 347 changes to 233 files
updating to branch default
233 files updated, 0 files merged, 0 files removed, 0 files unresolved

Now set up mercurial to know who you are:

sam@ubuntu:~/.ssh$ cd ~/mit/863.13/
sam@ubuntu:~/mit/863.13$ ls -a
. app.html .hgignore people projects
.. .hg index.html prior.html tutorials
sam@ubuntu:~/mit/863.13$ cd .hg/
sam@ubuntu:~/mit/863.13/.hg$ ls
00changelog.i cache hgrc store undo.branch undo.dirstate
branch dirstate requires undo.bookmarks undo.desc
sam@ubuntu:~/mit/863.13/.hg$ gedit hgrc

Edit this file to include:

[ui]
username = your name here <thing@thing.thing>
ssh = ssh -i ~/.ssh/classes -C

Step 4: Open Tortoise

Type thg at the command line, or run your executable. It should look like this:

Go to File > Open Repository and select our newly created repo. Now it should look like this:

Yay!

Step 5: Do stuff.

I'm adding the files for this tutorial. I right-clicked on the files and selected Add

After that, type a message and click Commit.

Step 6: Merge

Before I can push, I need to merge my commits with the rest of the world. Pull in work from everyone with Repository > Synchronize > Pull If there is more than one train track on the THG window, you need to merge. Make sure your work is committed, right click the other train track and select Merge to local. If no conflicts are detected, the merge will go smoothly.

Step 6: Push

Now there is only only one train track, it is safe to push. Use Repository > Synchronize > Push.

Other links