Sunday, January 30, 2011

Installing Mercurial on RHEL 5.5

Finally after a few attempts, I could install mercurial on RHEL.

Here are the steps I followed and thanks to a few forum posts, I found out my way through it.

So I tried all kinds of ways but what eventually worked was easy_install.

So this is what you need.

easy_install
python-setuptools

Downloaded the latest mercurial rpm.  Untar it.

Now if you dont have easy_install, install it by running the below command

wget http://pypi.python.org/packages/2.4/s/setuptools/setuptools-0.6c11-py2.4.egg#md5=bd639f9b0eac4c42497034dec2ec0c2b

Once you are done downloading run the below command

ronak@ronak ~ $ sudo sh setuptools-0.6c11-py2.4.egg
[sudo] password for ronak:
Processing setuptools-0.6c11-py2.4.egg
removing '/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg' (and everything under it)
creating /usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg
Extracting setuptools-0.6c11-py2.4.egg to /usr/lib/python2.4/site-packages
setuptools 0.6c11 is already the active version in easy-install.pth
Installing easy_install script to /usr/bin
Installing easy_install-2.4 script to /usr/bin

Installed /usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg
Processing dependencies for setuptools==0.6c11
Finished processing dependencies for setuptools==0.6c11




If you see this, easy_install is installed on your system.

Now, remember you have the untar directory mercurial1.7 (or whatever you have).  Make sure you are at that location.

Run the below command

ronak@ronak ~ $ sudo easy_install mercurial-1.7/
ronak@ronak ~ $ sudo easy_install mercurial-1.7/
Processing
Running setup.py -q bdist_egg --dist-dir /usr/local/home/rpatel/mercurial-1.7/egg-dist-tmp-bHHAXk
zip_safe flag not set; analyzing archive contents...
mercurial.help: module references __file__
mercurial.lsprof: module references __file__
mercurial.commands: module references __file__
mercurial.extensions: module references __file__
mercurial.i18n: module references __file__
mercurial.templater: module references __file__
hgext.mq: module references __file__
Adding mercurial unknown to easy-install.pth file
Installing hg script to /usr/bin

Installed /usr/lib/python2.4/site-packages/mercurial-unknown-py2.4-linux-i686.egg
Processing dependencies for mercurial==unknown
Finished processing dependencies for mercurial==unknown


ronak@ronak ~ $ hg
Mercurial Distributed SCM

basic commands:

 add        add the specified files on the next commit
 annotate   show changeset information by line for each file
 clone      make a copy of an existing repository
 commit     commit the specified files or all outstanding changes
 diff       diff repository (or selected files)
 export     dump the header and diffs for one or more changesets
 forget     forget the specified files on the next commit
 init       create a new repository in the given directory
 log        show revision history of entire repository or files
 merge      merge working directory with another revision
 pull       pull changes from the specified source
 push       push changes to the specified destination
 remove     remove the specified files on the next commit
 serve      start stand-alone webserver
 status     show changed files in the working directory
 summary    summarize working directory state
 update     update working directory (or switch revisions)

use "hg help" for the full list of commands or "hg -v" for details
ronak@ronak ~ $

Hurray... You are done..!!!!