Overview

==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
[[https://bitbucket.org/hsivank/xcode4-with-mercurial/get/tip.zip]]

===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 :

/usr/bin/git
/usr/local/bin/git
/Developer/usr/bin/git <- this is the one for default Xcode 4 installation
/Applications/Xcode.app/Contents/Developer/usr/bin/git <- this is the one for default Xcode >= 4.3 installation
...

===3/ move git binary
example : sudo cp /Developer/usr/bin/git /Developer/usr/bin/git.orig
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) 

===5/ copy hacked git.py
sudo cp git.py /Developer/usr/bin/git
sudo chmod +x /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
{{{
#!python
#f = open('/Users/user/git.txt', 'a')
#f.write(' '.join(sys.argv))
#f.write('\n')
#f.close()
}}}
and fill a ticket with /Users/user/git.txt ( [[https://bitbucket.org/hsivank/xcode4-with-mercurial/issues/new]] )