Mercurial 1.8.3 on Jython 2.5.2

Sébastien Deleuze seb at deleuze.fr
Wed May 11 22:00:13 UTC 2011


Thanks Matt, you're right.
The issue occur during following test in util.py:

if os.name == 'nt':
    from windows import *
else:
    from posix import *

In Jython, os.name return java, so I have replaced current code by
"from java import *" for the moment.

It now produces a new error :
C:\jython2.5.2\bin>jython ./hg
Traceback (most recent call last):
  File "./hg", line 36, in <module>
    mercurial.util.set_binary(fp)
AttributeError: 'module' object has no attribute 'set_binary'

On Wed, May 11, 2011 at 11:05 PM, Matt Mackall <mpm at selenic.com> wrote:
> On Wed, 2011-05-11 at 22:56 +0200, Sébastien Deleuze wrote:
>> Hi,
>>
>> I try to make Mercurial 1.8.3 working, even partially, with Jython
>> 2.5.2. I am working on a Java based forge. We are currently running
>> native Mercurial commands and parsing the outpout, but it would be far
>> better for us to embed Mercurial in Jython like we have done for
>> Docutils recently.
>>
>> With Jython 2.5.2, when I run "jython setup.py --pure", I get an error
>> during bz2 import. Thats normal since Jython does not support bz2 yet.
>> I have read on Jython bugtracker (http://bugs.jython.org/issue1445)
>> that bz2 is only used for bundles and archives, 2 functionnalities we
>> don't need, so I have commented bz2 check in setup.py.
>>
>> Without bz2 check installation and byte compilation is fine, but I get
>> the following error when running "jython hg"
>
> ...
>>   File "C:\mercurial-1.8.3\mercurial\posix.py", line 10, in <module>
>>     import os, sys, errno, stat, getpass, pwd, grp
>
> If posix.py is getting imported on Windows, you've got problems.
>
> The odds of the Java environment being sufficiently isolated from
> Windows' quirks for our purposes is pretty much nil, I imagine.
>
> --
> Mathematics is the supreme nostalgia of our time.
>
>
>



More information about the Mercurial mailing list