<br><br><div class="gmail_quote">On Thu, Dec 16, 2010 at 2:22 PM, Maciej Fijalkowski <span dir="ltr">&lt;<a href="mailto:fijall@gmail.com">fijall@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On Thu, Dec 16, 2010 at 12:14 PM, Dan Villiom Podlaski Christiansen<br>
&lt;<a href="mailto:danchr@gmail.com">danchr@gmail.com</a>&gt; wrote:<br>
&gt; On 16 Dec 2010, at 10:33, Antonio Cuni wrote:<br>
&gt;<br>
&gt;&gt; Alternatively, if you install mercurial you can then &quot;import<br>
&gt;&gt; mercurial.commands&quot; and use its public API from Python. Or as you said you<br>
&gt;&gt; can<br>
&gt;&gt; just execute hg log and parse the output: in this case you might be<br>
&gt;&gt; interested<br>
&gt;&gt; in the --template option, which allows you to format things exactly as you<br>
&gt;&gt; want, e.g.:<br>
&gt;<br>
&gt; &lt;snip&gt;<br>
&gt;<br>
&gt; I&#39;d suggest parsing the command line output of Mercurial, as it&#39;s the<br>
&gt; officially sanctioned stable API for Mercurial. The Python API, while<br>
&gt; faster, provides no stability guarantees. That being said, the following<br>
&gt; will create a repository instance and access the context for a particular<br>
&gt; changeset:<br>
&gt;<br>
&gt;&gt;&gt;&gt; from mercurial import hg, ui<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; repo = hg.repository(ui.ui(), &#39;path/to/repo&#39;)<br>
&gt;&gt;&gt;&gt; ctx = repo[&#39;tip&#39;]<br>
&gt;&gt;&gt;&gt; log = ctx.description()<br>
&gt;<br>
&gt; The typical accessors for a changeset context are defined at<br>
&gt; &lt;<a href="http://hg.intevation.org/mercurial/file/7397a53219c9/mercurial/context.py#l97" target="_blank">http://hg.intevation.org/mercurial/file/7397a53219c9/mercurial/context.py#l97</a>&gt;.<br>
&gt;<br>
&gt; Please note that any use of the Python API means that the entire application<br>
&gt; is covered by the GPL.<br>
&gt;<br>
<br>
</div></div>How is it even technically possible? It does not link against<br>
mercurial and GPL specifically excludes anything about *running* your<br>
software.<br>
<div><div></div><div class="h5">_______________________________________________<br>
<a href="mailto:pypy-dev@codespeak.net">pypy-dev@codespeak.net</a><br>
<a href="http://codespeak.net/mailman/listinfo/pypy-dev" target="_blank">http://codespeak.net/mailman/listinfo/pypy-dev</a><br>
</div></div></blockquote></div><br>Because the term &quot;link&quot; is totally meaningless in the context of Python code.  Some people say this means it&#39;s impossible for Python to invoke that clause of the GPL, others say it means `import`ing something invokes it.  There&#39;s no correct answer.<div>
<br></div><div>Alex<br clear="all"><br>-- <br>&quot;I disapprove of what you say, but I will defend to the death your right to say it.&quot; -- Evelyn Beatrice Hall (summarizing Voltaire)<br>&quot;The people&#39;s good is the highest law.&quot; -- Cicero<br>
&quot;Code can always be simpler than you think, but never as simple as you want&quot; -- Me<br>
</div>