Mercurial 1.8.3 on Jython 2.5.2

Sébastien Deleuze seb at deleuze.fr
Thu May 12 07:29:20 UTC 2011


OK, understood, I tried to import java module, wich has nothing to do
with posix ou windows modules.

I also tried with import windows, but if I do I got error sine it uses ctypes:

    _kernel32 = ctypes.windll.kernel32
  File "C:\jython2.5.2\Lib\site-packages\mercurial\demandimport.py", line 76, in
 __getattribute__
    return getattr(self._module, attr)
AttributeError: 'module' object has no attribute 'windll'

>From what I understand, the only way to make it work is to write a
pure equivalent of posix.py or win32.py.
Do you think it is technicaly possible ?

A major issue may be that java runtime don't care about file
permissions (at least in java6/7, it may be the case in java 8), but
for read only capabilities it may be not an issue for me.

Thanks in advance for your help.
Sébastien

On Thu, May 12, 2011 at 8:38 AM, Martin Geisler <mg at aragost.com> wrote:
> Sébastien Deleuze <seb at deleuze.fr> writes:
>
>> 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.
>
> Did you really write "from java import *"? There is not mercurial.java
> module unless you created one.
>
> For a start, you should try with:
>
>  if os.name == 'nt' or os.name == 'java':
>      from windows import *
>  else:
>      from posix import *
>
>> 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'
>
> Then the set_binary function will be imported from mercurial.windows
> into mercurial.util.
>
> As Matt said, this will probably not be enough, but maybe you can get
> some basic commands running.
>
> --
> Martin Geisler
>
> aragost Trifork
> Professional Mercurial support
> http://mercurial.aragost.com/kick-start/
>



More information about the Mercurial mailing list