Mercurial in pure Java
Andrey Somov
py4fun at gmail.com
Fri Oct 2 17:14:47 CDT 2009
> Remy Blank wrote:
>> Theodore Tso wrote:
>>> So I wouldn't be too quick to rule out having a Eclipse plugin,
>>> written in Java, call out to Python-based Mercurial cli.
>> And if the CLI is not good enough, write a GPL-2 plugin for Mercurial
>> that provides an RPC interface to the Mercurial code through
>> stdin/stdout or a socket, and use that interface from your Eclipse plugin.
>>
>> It still requires Python to run, though.
>
> That's probably the way to go. No licencing issues since all code that
> is a derivative work of Mercurial is GPLed, and you just need the user
> to do the 'obvious' thing of installing Mercurial separately, which
> they'd probably do anyway.
>
> That's also quite likely to be the most performant approach without a
> lot of work.
>
> Tom
>
I wanted to stay away but I cannot...
Python has heapq module which implements "the priority queue algorithm."
Why to bother to implement it in Python ? Why not to take it from Java ?
It is simple:
- download and install Java
- install library which implements the priority queue algorithm
- take care that the Java version matches the one required by the library
- write a small Java program for the interface
- launch Java from Python and execute the program
- parse the output taking care that another version of Java or the
library may change it
- get the result and use in your Python program
Is it the way to go ? (I hope you can see the symmetry with Python and
Mercurial)
-
Andrey
More information about the Mercurial
mailing list