sshpeer: use a 'bufferedinputpipe' for standard output of the ssh process
authorPierre-Yves David <pierre-yves.david@fb.com>
Sun, 31 May 2015 00:00:36 -0700
changeset 25407 e461230cc95b
parent 25406 be930f16a52a
child 25408 c88975a4d264
sshpeer: use a 'bufferedinputpipe' for standard output of the ssh process We need this pipe to still be buffered when will switch to unbuffered pipe. (switch motivated by the need of using polling to restore real time output from ssh server). This is the only pipe that needs to be wrapped because this is the one who do extensive usage of 'readline'. The stderr pipe of the process is alway read in non blocking raw chunk, so it won't benefit from the buffering.
mercurial/sshpeer.py
--- a/mercurial/sshpeer.py	Sat May 30 23:55:24 2015 -0700
+++ b/mercurial/sshpeer.py	Sun May 31 00:00:36 2015 -0700
@@ -89,6 +89,8 @@
         # to clean up correctly later
         self.pipeo, self.pipei, self.pipee, self.subprocess = util.popen4(cmd)
 
+        self.pipei = util.bufferedinputpipe(self.pipei)
+
         # skip any noise generated by remote shell
         self._callstream("hello")
         r = self._callstream("between", pairs=("%s-%s" % ("0"*40, "0"*40)))