<div dir="ltr">Last week I'had implemented the log command using some of Martin <div><div class="gmail_extra">advice creating a like-iterator mechanism.<br>[<a href="https://bitbucket.org/istana/c-hglib/commits/5b98a2a7f0d2bd72dd12d8fb36ebd86b044a84f8">https://bitbucket.org/istana/c-hglib/commits/5b98a2a7f0d2bd72dd12d8fb36ebd86b044a84f8</a>]</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Meanwhile I make a new sketch for level 1 commands.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Please take a look on this sketch .<br><pre style="white-space:pre-wrap;word-wrap:break-word">
<br></pre><pre style="white-space:pre-wrap;word-wrap:break-word">hg add command
</pre><pre style="white-space:pre-wrap;word-wrap:break-word">int hg_add(hg_handle *handle, char *arguments[]);

Using hg add description from [<a href="http://www.selenic.com/mercurial/hg.1.html#add" target="_blank">http://www.selenic.com/mercurial/hg.1.html#add</a>], 
hg_add command will return 0 if all files are successfully added.


The argument list will contain options and files that user will 
want to add. 

Options:

-I, --include   include names matching the given patterns
-X, --exclude   exclude names matching the given patterns
-S, --subrepos  recurse into subrepositories
-n, --dry-run   do not perform actions, just print output


>From what I see on python-hglib, [<a href="http://selenic.com/repo/python-hglib/file/c13b99b01008/hglib/client.py#l202" target="_blank">http://selenic.com/repo/python-hglib/file/c13b99b01008/hglib/client.py#l202</a>], 
Idank used a field 'files', but in this way I think that you can 
not use --include and --exclude option in the same time. 

If I will use an argument list that will containt options/files 
that will be ordinate I could perform this kind of operation. 

I have 2 more options for how hg_add signature could look:

int hg_add(hg_handle *handle, char *files[], char *arguments[]);
int hg_add(hg_handle *handle, char *arguments[], ...); using variable number of option

About the return value for this command, like I said before it will 
return the exitcode,(I can find cmd-server exitcode list anywhere).
But like I discuss on [<a href="http://markmail.org/message/pofplkyodyoxp5mq" target="_blank">http://markmail.org/message/pofplkyodyoxp5mq</a>] 
there is a possibility to having some output on 'o'/'e'/'d' channels. 

In add command case and probably other cases you don't need to receive
error data to know what it's wrong or the debug data. Sometimes the 
exitcode it's all that you need. But I cannot ignore this data or user
desires. 
I would like to add some pointers on handle structures where the 
output/error/debug data to be store. (unparsed data, for this kind of 
commands with low amount of data)

I would like to talk ASAP about this issue. There are much more 
commands that could fit on this pattern. Commands like commit, push, 
pull, import/export that needs some little changes. 

</pre><div><br></div>-- <div dir="ltr"><div>Iulian</div></div>
</div></div></div>