[PATCH 9 of 9] chgserver: implement a simple "runcommand"
Yuya Nishihara
yuya at tcha.org
Sat Nov 19 04:06:37 EST 2016
On Sun, 13 Nov 2016 21:55:53 +0000, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark at fb.com>
> # Date 1479073486 0
> # Sun Nov 13 21:44:46 2016 +0000
> # Node ID b923b234b9032cdd87e6519dae7fbfdd292b7b40
> # Parent 4660680374d24f7d46834b54de2fbbeec164e906
> chgserver: implement a simple "runcommand"
>
> Although the chgserver could just use command server's runcommand. The new
> design could be very simple - no need to do ui copying etc. So let's write
> it down explicitly to use the simple version.
>
> Future patches improving the pager area also requires a different
> "runcommand" from the "commandserver" version.
>
> diff --git a/mercurial/chgserver.py b/mercurial/chgserver.py
> --- a/mercurial/chgserver.py
> +++ b/mercurial/chgserver.py
> @@ -438,4 +438,12 @@ class chgcmdserver(commandserver.server)
> os.chdir(path)
>
> + def runcommand(self):
> + """Reads a list of \0 terminated arguments, executes and writes the
> + return code to the result channel"""
> + args = self._readlist()
> + req = dispatch.request(args[:])
self.cin/cout/cerr should be passed for correctness. The server doesn't
guarantee they are replaced with std streams by attachio.
More information about the Mercurial-devel
mailing list