<div dir="ltr"><div>Hello Idan,<br><br>2013/8/2 Idan Kamara <<a href="mailto:idankk86@gmail.com">idankk86@gmail.com</a>><br>>   On Thu, Aug 1, 2013 at 2:18 PM, Iulian Stana <<a href="mailto:julian.stana@gmail.com">julian.stana@gmail.com</a>> wrote:<br>
><br>>   >   Even if level 0 is not validated yet, I am exploring what level 1 might look like.<br>>   >   Here are some sketches:<br>>   ><br>>   >   Start with some basic commands that everybody will use.<br>
>   >   (add, commit, push, pull, log, import/export, merge, verify) <br>><br>>   What added value do these functions have over calling rawcommand?<br>>   The signature isn't command specific, and the return value is unparsed.<br>
<br>As far as I have understood, it goes like this:<br><br>hg_add (to name one of them) doesn't just call hg_rawcommand, but calls:<br><br>hg_rawcommand<br>hg_rawread<br>hg_rawread<br>[... as many hg_rawread as needed, output is read in 4k sized chunks]<br>
hg_exitcode<br><br>other commands (like hg_import) will require calls to hg_rawwrite too<br>(again, data to be written is split into chunks).<br>The exact sequence _is_ command specific.<br><br>You can see a fiew example in main.c here: <a href="http://markmail.org/message/s2qiztjbqqzbltyr">http://markmail.org/message/s2qiztjbqqzbltyr</a><br>
<br>You also say "the return value is unparsed."<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 it is.<br><br></div>Iulian, am I saying right?<br><div><br>Cheers,<br>Giovanni<br>
</div></div>