Sketch the header for level 1

Iulian Stana julian.stana at gmail.com
Sat Aug 17 05:25:48 CDT 2013


Last week I'had implemented the log command using some of Martin
advice creating a like-iterator mechanism.
[
https://bitbucket.org/istana/c-hglib/commits/5b98a2a7f0d2bd72dd12d8fb36ebd86b044a84f8
]

Meanwhile I make a new sketch for level 1 commands.

Please take a look on this sketch .


hg add command

int hg_add(hg_handle *handle, char *arguments[]);

Using hg add description from [http://www.selenic.com/mercurial/hg.1.html#add],
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,
[http://selenic.com/repo/python-hglib/file/c13b99b01008/hglib/client.py#l202],
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 [http://markmail.org/message/pofplkyodyoxp5mq]
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.



-- 
Iulian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20130817/f6771a3a/attachment.html>


More information about the Mercurial-devel mailing list