Prompts on hglib API

Idan Kamara idankk86 at gmail.com
Tue Sep 17 08:48:31 UTC 2013


On Sat, Aug 31, 2013 at 8:59 PM, Iulian Stana <julian.stana at gmail.com>wrote:

> Hi,
>
> Sorry for my disturbing, I am trying to implement some hg commands that
> probably will have prompts messages. Merge command for example.
>
> From what I already understand you must send a zero-length message to
> command server to stop server asking about input data ( 'I' or 'L'
> channels).
>
> I would like to ask you, how you had handled this issue:
>
> 1) do you expect the users of your code, to write handlers that manage
> themselves to send the zero length at the end of their reply to prompts ?
> 2) do you execute the user-defined handlers and _then_ you send yourself
> the zero length message?
>
> I think that you cannot assume that after a prompt message, will be no
> other input data to send....
>

Did you go over how python-hglib does this? These are the interesting
pieces:

1) low level input write -
http://selenic.com/repo/python-hglib/file/c13b99b01008/hglib/client.py#l112
2) low level prompts -
http://selenic.com/repo/python-hglib/file/c13b99b01008/hglib/client.py#l162
3) merge usage of prompts -
http://selenic.com/repo/python-hglib/file/c13b99b01008/hglib/client.py#l1006
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-devel/attachments/20130917/a1aa3fd2/attachment-0002.html>


More information about the Mercurial-devel mailing list