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

https://bitbucket.org/hsivank/xcode4-with-mercurial/get/tip.zip

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 :

/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 ( Xcode >= 4.3) ...

3/ move git binary

example :

sudo cp /Applications/Xcode.app/Contents/Developer/usr/bin/git \
/Applications/Xcode.app/Contents/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)

> head `which hg`
#!/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
#
# 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))
#f.write('\n')
#f.close()

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

Updated

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.