diff --git a/mercurial/sshpeer.py b/mercurial/sshpeer.py --- a/mercurial/sshpeer.py +++ b/mercurial/sshpeer.py @@ -337,13 +337,16 @@ return protoname, caps class sshv1peer(wireproto.wirepeer): - def __init__(self, ui, url, proc, stdin, stdout, stderr, caps): + def __init__(self, ui, url, proc, stdin, stdout, stderr, caps, + autoreadstderr=True): """Create a peer from an existing SSH connection. ``proc`` is a handle on the underlying SSH process. ``stdin``, ``stdout``, and ``stderr`` are handles on the stdio pipes for that process. ``caps`` is a set of capabilities supported by the remote. + ``autoreadstderr`` denotes whether to automatically read from + stderr and to forward its output. """ self._url = url self._ui = ui @@ -353,8 +356,9 @@ # And we hook up our "doublepipe" wrapper to allow querying # stderr any time we perform I/O. - stdout = doublepipe(ui, util.bufferedinputpipe(stdout), stderr) - stdin = doublepipe(ui, stdin, stderr) + if autoreadstderr: + stdout = doublepipe(ui, util.bufferedinputpipe(stdout), stderr) + stdin = doublepipe(ui, stdin, stderr) self._pipeo = stdin self._pipei = stdout