Running multiple commands on commandserver interface

Ton Plomp tcplomp at gmail.com
Thu Apr 12 15:20:23 UTC 2012


I'm pretty sure I wait untill the process has finished, I start a new
command after I read a final null dword on the 'r' channel:

r\00\00\00\04\00\00\00\00 (this should mean that a message NULL is posted
at the 'r' channel).

I finish the handling of the messages from the server after I have finished
the 'r' channel.

Ton



2012/4/12 Martin Geisler <mg at aragost.com>

> Ton Plomp <tcplomp at gmail.com> writes:
>
> > Hello All,
> >
> > I have some issues (mainly speed) with the command line interface of
> > mercurial, so I changed to the commandserver interface via pipes.
> >
> > I thought it was possible to keep one server active per repository and
> > communicate continuously via stdin, however if I want to run a second
> > command on the same pipe the process is closed by the server.
> >
> > Here's a traceback from the error output:
> >
> > Traceback (most recent call last):
> > File "mercurial\dispatch.pyo", line 87, in _runcatch
> > File "mercurial\dispatch.pyo", line 683, in _dispatch
> > File "mercurial\dispatch.pyo", line 465, in runcommand
> > File "mercurial\dispatch.pyo", line 737, in _runcommand
> > File "mercurial\dispatch.pyo", line 691, in checkargs
> > File "mercurial\dispatch.pyo", line 680, in <lambda>
> > File "mercurial\util.pyo", line 456, in check
> > File "mercurial\extensions.pyo", line 139, in wrap
> > File "mercurial\util.pyo", line 456, in check
> > File "hgext\mq.pyo", line 3337, in mqcommand
> > File "mercurial\util.pyo", line 456, in check
> > File "mercurial\commands.pyo", line 5053, in serve
> > File "mercurial\commandserver.pyo", line 231, in serve
> > File "mercurial\commandserver.pyo", line 215, in serveone
> > Abort: unknown command\00runcommand
> > abort: unknown command\00runcommand
> >
> >
> > I write the same command twice to the pipe:
> > runcommand\n\00\00\00\03log\00
> >
> > As soon as the second command is run the server is closed
> >
> > Does anybody know if it's possible to use the same pipe for multiple
> > commands?
>
> Yes, we do that all the time in JavaHg: we start one Mercurial command
> server process and send multiple commands to it (one command at a time).
>
> Could the problem be that you didn't wait for the first command to
> finish before starting another?
>
> --
> Martin Geisler
>
> aragost Trifork
> Professional Mercurial support
> http://aragost.com/mercurial/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20120412/be28092c/attachment-0002.html>


More information about the Mercurial mailing list