1. hsivank
  2. Xcode4 with Mercurial


Clone wiki

Xcode4 with Mercurial / Home

Xcode4 with Mercurial

Xcode4 only support Git and does not provide plugin api. This script is a radical solution to bring Mercurial support into Xcode4

1/ get git.py


wget https://bitbucket.org/hsivank/xcode4-with-mercurial/get/tip.zip --no-check-certificate

2/ you will need to find current Git binary used by Xcode 4 into your system

( be careful more than one Git could be installed on your system )-:
Depending of Xcode4 version, it could be :



/Developer/usr/bin/git <- this is the one for default Xcode 4 installation

/Applications/Xcode.app/Contents/Developer/usr/bin/git ( Xcode >= 4.3) ...

3/ move git binary

example :

sudo cp /Applications/Xcode.app/Contents/Developer/usr/bin/git \

New: use the name git.orig in the same directory, so that the script can revert to git when it's an actual git repository.

4/ customize git.py

You should modify first line of git.py with your python interpreter path (the one returned by "head `which hg`" is probably a good bet)

> head `which hg`
# mercurial - scalable distributed SCM
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.

5/ copy hacked git.py

sudo cp git.py /Applications/Xcode.app/Contents/Developer/usr/bin/git
sudo chmod +x /Applications/Xcode.app/Contents/Developer/usr/bin/git

That's all ! you should be able to clone your preferred reposit from bitbucket.org with Xcode4 Organizer ;-)

Xcode4 will use our git binary as usual ... except that mercurial will be used as backend

Note : if you got previous Mercurial reposit just create an empty .git folder at reposit root before Xcode4 import.

If you find a bug, uncomment this lignes in git.py

#f = open('/Users/user/git.txt', 'a')
#f.write(' '.join(sys.argv))

and fill a ticket with /git.txt ( https://bitbucket.org/hsivank/xcode4-with-mercurial/issues/new )