[PATCH 0 of 2 RFC C-hglib] c-hglib: level 1 prototypes for mercurial commands (introduction)

Iulian Stana julian.stana at gmail.com
Thu Aug 29 12:03:00 UTC 2013


This is a draft of my work for c-hglib up to now, I am sending this to the list
for public review (even if this is not a patch for the core mercurial). I am
sure that the main developers following my work (Matt, Pierre-Yves, Idan and
others) will have important remarks on the architecture and on the style, and I
like to solicit those feedbacks.

This patchbomb will show the prototypes for level 1 mercurial commands.
I don't have a strong opinion if those prototypes are the best ones.


""""
There are two possibilities on how level 1 commands can behave:

(1) Return immedietely after having sent the command to commandserv,
    just wrapping a call to hg_rawcommand().
    Other API functions are provided to retrieve:
    (a) the data sent in response by the commandserv, in parsed
(structured) form
    (b) the exitcode, i.e. the content of the 'r' channel after all things
        have happened.
(2) Wait for the commandserv to complete *all* his actions in response to
    the issued command, which is cache the commandserv response somewhere,
    and return the actual exitcode (channel 'r' from commandserv)
    as the result of the chglib API call

"""

We called those two possibilities model (1) and model (2). The hg_log command
will use the first model (1) and the hg_add command will use second one, model
(2).


More information about the Mercurial-devel mailing list