Back in 2007, Charles Nutter posted a suggestion: get Mercurial (also
called hg) running on Jython. At the time I downloaded hg to give it a
try. This was before Jython 2.2 was released, and it did not go well.
Mercurial would not even compile, and if you know much about compiling
Jython or Python, you might know that getting something to compile is
about 1/4 of the battle.
Much has happened in Jython since 2007, 2.2 is out, and we are a
getting very close to a release of 2.5. Recently, Dirkjan Ochtman has
been making changes to Mercurial to better support other
implementations of Python. For example, the parts of Mercurial that
where implemented in C have pure Python fallbacks now. To avoid
performance issues in the default case, these pure python fallbacks
need to be compiled in.
To test this out in Jython, get a copy of the latest mercurial
hg clone http://selenic.com/repo/hg
Go to the hg directory and compile hg with the "pure" option (thanks
to mohbana on #jython irc for the recipe used):
jython setup.py --pure build_py -c -d . build_ext -i build_mo
then cd to the "tests" directory and (for now) apply this change to
run-tests.py and run
jython run-tests.py --pure
This should start the hg test harness. There are *lots* of failures,
but also plenty of heart warming success dots.
mohbana (again from #jython irc) says that he has had success with "hg
init", "hg tip", and "hg add".
We are getting closer!