Frage

How to install Mercurial and TortoiseHG on CentOS 6.5?

This is not trivial, as there is no official RPM for this.
See procedure as a bash script below.

I hope this helps

War es hilfreich?

Lösung

This procedure is a joining of instructions from several locations.
Create a script with the content below and run it as root.

#!/bin/bash
# Installation of mercurial and TortoiseHG

APPS_BASE=/opt
HG_BIN=$APPS_BASE/bin
HG_REPOS=$APPS_BASE/repos

checkResult()
{
    if [ $1 -ne 0 ]
    then
        echo;echo ERROR: $2 failed;echo
        exit 1
    else
        echo;echo Action $2 OK;echo
    fi
}

######### Start here #########

echo;echo Adding epel-release repository
yum -y install http://ftp.uninett.no/linux/epel/6/i386/epel-release-6-8.noarch.rpm
checkResult $? "yum install epel-release"

# Get more prereq packages
echo;echo Install some more packages needed
yum -y install PyQt4-devel python-devel python-iniparse gcc gettext
checkResult $? "yum install PyQt4-devel python-devel python-iniparse gcc gettext"

yum --enablerepo=epel -y install qscintilla-python python-keyring python-sphinx Django
checkResult $? "yum install qscintilla-python python-keyring python-sphinx Django"

# Install Mercurial from source to bootstrap
echo;echo Get and install Mercurial from source
mkdir $HG_BIN $HG_REPOS

cd $HG_REPOS
wget https://www.mercurial-scm.org/release/mercurial-2.4.2.tar.gz
checkResult $? "wget for mercurial"

tar xzvf mercurial-2.4.2.tar.gz
cd mercurial-2.4.2/
make local
checkResult $? "make local for mercurial"

# Get a Mercurial clone, to stay up to date
echo;echo Get and install Mercurial stable
./hg clone https://www.mercurial-scm.org/repo/hg#stable ../hg
checkResult $? "hg clone https://www.mercurial-scm.org/repo/hg#stable"

cd ../hg
make local
checkResult $? "make local for mercurial stable"

echo;echo Create link for hg
cd $HG_BIN
ln -s $HG_REPOS/hg/hg .

# now get a TortoiseHg clone
echo;echo Get the TortoiseHG
cd $HG_REPOS
$HG_BIN/hg clone https://bitbucket.org/tortoisehg/thg thg
checkResult $? "hg clone https://bitbucket.org/tortoisehg/thg"

echo;echo Create links for thg
cd thg
ln -s ../hg/mercurial/
ln -s ../hg/hgext/
cd $HG_BIN
ln -s $HG_REPOS/thg/thg .

echo;echo Install kdiff3
yum -y install kdiff3
checkResult $? "yum install kdiff3"

# Cleanup
echo;echo Cleanup
rm -rf $HG_REPOS/mercurial-2.4.2/ $HG_REPOS/mercurial-2.4.2.tar.gz

echo;echo Add $HG_BIN to path
echo "export PATH=$HG_BIN:$PATH" >> /etc/profile

Once this is done, you will have two links

/opt/bin/hg - mercurial
/opt/bin/thg - tortoiseHg

Of course you can easily move things around as you see fit.

EDIT: If anyone has an idea on how to get the nautilus extensions working, please add here!
EDIT 2: (Contributed by @Will-I-am-davidon). Needed to install some more packages to get the thg working: yum install PyQt qscintilla qscintilla-python

Andere Tipps

Didnt work for me sorry !!! After having been spent 2 Hours finding the issue for "incorrect data format" I just removed checkSum() and everywhere below wrote ECHO

it worked for me 100%

THANKs =)

In my case i wanna update my production server with a project of my own hosted in BitBucket.org, so you try as i did with Installing on CentOS 6.3

As outlined in Mercurial Download, create /etc/yum.repos.d/mercurial.selenic.com.repo and paste in the following:

[mercurial.selenic.com]
name=mercurial.selenic.com
baseurl=https://www.mercurial-scm.org/release/centos$releasever
enabled=1
# Temporary until we get a serious signing scheme in place,
# check https://www.mercurial-scm.org/wiki/Download again
gpgcheck=0

Then you can issue the command sudo yum install hg.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top