[pypy-dev] speed.pypy.org and mercurial

Maciej Fijalkowski fijall at gmail.com
Thu Dec 16 20:22:27 CET 2010

On Thu, Dec 16, 2010 at 12:14 PM, Dan Villiom Podlaski Christiansen
<danchr at gmail.com> wrote:
> On 16 Dec 2010, at 10:33, Antonio Cuni wrote:
>> Alternatively, if you install mercurial you can then "import
>> mercurial.commands" and use its public API from Python. Or as you said you
>> can
>> just execute hg log and parse the output: in this case you might be
>> interested
>> in the --template option, which allows you to format things exactly as you
>> want, e.g.:
> <snip>
> I'd suggest parsing the command line output of Mercurial, as it's the
> officially sanctioned stable API for Mercurial. The Python API, while
> faster, provides no stability guarantees. That being said, the following
> will create a repository instance and access the context for a particular
> changeset:
>>>> from mercurial import hg, ui
>>>> repo = hg.repository(ui.ui(), 'path/to/repo')
>>>> ctx = repo['tip']
>>>> log = ctx.description()
> The typical accessors for a changeset context are defined at
> <http://hg.intevation.org/mercurial/file/7397a53219c9/mercurial/context.py#l97>.
> Please note that any use of the Python API means that the entire application
> is covered by the GPL.

How is it even technically possible? It does not link against
mercurial and GPL specifically excludes anything about *running* your

More information about the Pypy-dev mailing list