Mercurial on Ubuntu

How did I get Mercurial working (on Ubuntu)?

I worked off of Kenny Cheung’s notes, with a few minor changes (not sure if they’re required).

  • Make sure you have Mercurial, or get it with sudo apt-get install mercurial
  • Save the “classes” and “” keys in ~/.ssh/keys/
  • Edit permissions of the keys with chmod go-rw ~/.ssh/keys/*
  • Set up a Mercurial config file in ~/.hgrc. Mine looks like:
    username = Matt Edwards <>
    ssh = ssh -p port -i ~/.ssh/keys/classes -x
    editor = emacs -nw --no-site-file
    convert =
    fetch =
    changegroup = hg update >&2
  • Run Neil’s hgclone script (classes is the name of the private key): ./ 863.12 classes 846
  • Things should work now, test with an
    cd 863.12
    hg pull

Extra note: If you have X forwarding on and get an annoying message like remote: X11 forwarding request failed on channel 0, fix it by adding this to your ~/.ssh/config:

ForwardX11 no

To still X forward with other hosts (since the global default has to be ForwardX11 no), add something else like:

Host *
ForwardX11 yes