Thursday, October 29, 2009

Install Mercurial distributed version control system and TortoiseHg GUI client on Ubuntu Linux

Share/Save/Bookmark
TortoiseHg requires a newer version of Mercurial than what is available by default in the Ubuntu repositories. These steps include installing the latest release of Mercurial from their repository. In the following steps, replace "jaunty" with the appropriate Ubuntu version (intrepid, hardy, etc.).

Install Mercurial


Add the following to /etc/apt/sources.list:
deb http://ppa.launchpad.net/mercurial-ppa/releases/ubuntu jaunty main
deb-src http://ppa.launchpad.net/mercurial-ppa/releases/ubuntu jaunty main

Then run:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 323293EE
sudo apt-get update
sudo apt-get install mercurial


Install TortioseHg

Add the following to /etc/apt/sources.list:
deb http://ppa.launchpad.net/tortoisehg-ppa/releases/ubuntu jaunty main
deb-src http://ppa.launchpad.net/tortoisehg-ppa/releases/ubuntu jaunty main


Then run:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key D5056DDE
sudo apt-get update
sudo apt-get install tortoisehg


Install iniparse:
Download http://iniparse.googlecode.com/files/python-iniparse_0.3.1-1_all.deb
Run:
sudo dpkg -i python-iniparse_0.3.1-1_all.deb

You can verify that they installed correctly by running:
hg version
hg help
hgtk version
hgtk help

The main comands for TortoiseHg are:
hgtk log

hgtk status

hgtk commit

hgtk annotate


The interface for commit is actually a superset of the interface for status, so you can easily get away with only using the commit command because it provides all the same operations and more. Both of them support:
diff
add
revert
log (file history)

I prefer to run the following Mercurial operations from command line:
hg pull
hg push

For several commands I like to switch between using the command line and using the GUI client. It's always good to have both options.

References:
Mercurial:
http://mercurial.selenic.com/
Mercurial PPA:
https://launchpad.net/~mercurial-ppa
Mercurial Releases:
https://launchpad.net/~mercurial-ppa/+archive/releases
TortoiseHg PPA:
https://launchpad.net/~tortoisehg-ppa
TortoiseHg releases
https://launchpad.net/~tortoisehg-ppa/+archive/releases
iniparse:
http://code.google.com/p/iniparse/

1 comment:

  1. Thank you. I didn't follow your advice to the letter, but it got me on the right track (had to install mercurial before tortoisehg).

    ReplyDelete