[PATCH 51 of 55 RFC c-hglib:level1] hg_tip: creating a high level function for mercurial tip command

Iulian Stana julian.stana at gmail.com
Sat Sep 14 07:34:07 CDT 2013


> + *
>> + * \param handle The handle of the connection, wherewith I want to
>> communicate
>> + * \param callback A function that will handle error data.
>> + *                 A NULL pointer will ignore error data.
>>
>
> What meaningful thing can a user do in this callback?
>
>

What ever he wants to do with error data, print it do the stderr, store in
some place
or I don't know parse this data in his own way is his decision.



> + * \param argument The option list. Will contain all option that you wish.
>>
>
> If you let the user pass in more arguments, it has the potential of:
>
> 1) breaking your changeset parser (user passed --template)
> 2) leaving unparsed data after you successfully parsed the changeset (not
> sure how you deal with that)
>
>
The last --template will overwrite all preview templates probably I must
tell in
documentation that is not allowed to use other template...

hg tip --template '{rev}' --template '{node}' --template 'Template - {rev}
- {node}\n'

I'm not sure you really want that.
>

I really don't want to leave unparse data.


>
>
>> + * \retval cset The command return succesful, with a parse data.
>>
>
> hg tip always returns a single changeset, wouldn't it be nicer if you
> received a pointer
> to hg_cset_entry and wrote the result there, rather than allocating one
> inside?
>

Probably, I don't know:) I thought that it would be nice to return a
cset_entry and
to give user less work to do :) But this thing can be easy changed.


>
>
>> + * \retval NULL  The command failed.
>> + *
>> + * errno can be:
>> + *      - hg_rawcommand errors
>> + *
>> + * */
>> +hg_cset_entry *hg_tip(hg_handle *handle, int(*callback)(const char *msg,
>> +                                               size_t len), char
>> *argument[]);
>> +
>>  /**
>>   * \brief The yield mechanism that will get the next entry.
>>   *
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel at selenic.com
>> http://selenic.com/mailman/listinfo/mercurial-devel
>>
>
>
Thanks for your replay :)

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


More information about the Mercurial-devel mailing list