[PATCH 3 of 4 V2] sshpeer: use the doublepipe object for the server to client channel

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed Jun 3 20:57:58 CDT 2015


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1432140108 18000
#      Wed May 20 11:41:48 2015 -0500
# Node ID 5037e99ddc08fb409eaed395fd5c0a460317eec6
# Parent  de758a24431a2b310a131d86d083bfe53826c349
sshpeer: use the doublepipe object for the server to client channel

This restore real time output from ssh server while waiting for protocol data
sent by the server.

diff --git a/mercurial/sshpeer.py b/mercurial/sshpeer.py
--- a/mercurial/sshpeer.py
+++ b/mercurial/sshpeer.py
@@ -158,10 +158,11 @@ class sshpeer(wireproto.wirepeer):
         # move to threading.
         sub = util.popen4(cmd, bufsize=0)
         self.pipeo, self.pipei, self.pipee, self.subprocess = sub
 
         self.pipei = util.bufferedinputpipe(self.pipei)
+        self.pipei = doublepipe(self.ui, self.pipei, self.pipee)
 
         # skip any noise generated by remote shell
         self._callstream("hello")
         r = self._callstream("between", pairs=("%s-%s" % ("0"*40, "0"*40)))
         lines = ["", "dummy"]
diff --git a/tests/test-ssh.t b/tests/test-ssh.t
--- a/tests/test-ssh.t
+++ b/tests/test-ssh.t
@@ -394,12 +394,12 @@ Test hg-ssh in read-only mode:
   $ echo "baz" > bar
   $ hg ci -A -m "unpushable commit" bar
   $ hg push --ssh "sh ../ssh.sh"
   pushing to ssh://user@dummy/*/remote (glob)
   searching for changes
+  remote: Permission denied
   abort: pretxnopen.hg-ssh hook failed
-  remote: Permission denied
   [255]
 
   $ cd ..
 
 stderr from remote commands should be printed before stdout from local code (issue4336)


More information about the Mercurial-devel mailing list