<div dir="ltr">On Mon, Aug 5, 2013 at 11:29 AM, Giovanni Gherdovich <span dir="ltr"><<a href="mailto:g.gherdovich@gmail.com" target="_blank">g.gherdovich@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hello Idan,<br><br>Idan wrote:<br>:::: On Fri, Aug 2, 2013 at 3:59 PM, Giovanni Gherdovich<br>:::: <g.gherdovich at <a href="http://gmail.com" target="_blank">gmail.com</a>>wrote:<br>:::: <br>:::: > Hello Idan,<br>

:::: > [...]<br>:::: > You also say "the return value is unparsed."<div class="im"><br>:::: > Well, it cannot be otherwise; the only "structured" piece of data is<br>:::: > the content of the 'r' channel (read by hg_exitcode).<br>

:::: ><br>:::: > The rest of the output, namely 'o' and 'e' channels, is just flat text.<br>:::: > It cannot be parsed since the content and format can change from<br>:::: > a hg release to the next. So the only way to deal with it is to take it as<br>

:::: > it is.<br>:::: ><br>:::: <br>:::: That's not true and if it were these libraries we're trying to create around<br>:::: hg wouldn't be all that useful.<br>:::: <br>:::: You can see here[1] that python-hglib test suite runs on hg versions going<br>

:::: back to 1.9.3 and have survived several big releases with only a few changes<br>:::: in Mercurial's output during that time, which in some cases would have gone<br>:::: unnoticed had python-hglib been more liberal in parsing the output.<br>

<br></div>Actually now that you point this out, I can see that "import re" in<br><a href="http://selenic.com/repo/python-hglib/file/c13b99b01008/hglib/client.py" target="_blank">http://selenic.com/repo/python-hglib/file/c13b99b01008/hglib/client.py</a><br>

and quite a lot of result for CTRL+F 're.' in that code.<br><br>Ok, Iulian will implement some output parsing in level 1 functions.<br>Err... How do people do regex matching in C?</div></blockquote><div><br></div>
<div>Most commands have a very simple output format, others support templating. I doubt</div><div>there's a real need for regular expressions.</div></div></div>