Running multiple commands on commandserver interface

Martin Geisler mg at aragost.com
Thu Apr 12 08:48:19 UTC 2012


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/



More information about the Mercurial mailing list