Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/sshpeer.py @ 25407:e461230cc95b
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.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Sun, 31 May 2015 00:00:36 -0700 |
parents | cf90764f40a4 |
children | c88975a4d264 |
comparison
equal
deleted
inserted
replaced
25406:be930f16a52a | 25407:e461230cc95b |
---|---|
86 cmd = util.quotecommand(cmd) | 86 cmd = util.quotecommand(cmd) |
87 | 87 |
88 # while self.subprocess isn't used, having it allows the subprocess to | 88 # while self.subprocess isn't used, having it allows the subprocess to |
89 # to clean up correctly later | 89 # to clean up correctly later |
90 self.pipeo, self.pipei, self.pipee, self.subprocess = util.popen4(cmd) | 90 self.pipeo, self.pipei, self.pipee, self.subprocess = util.popen4(cmd) |
91 | |
92 self.pipei = util.bufferedinputpipe(self.pipei) | |
91 | 93 |
92 # skip any noise generated by remote shell | 94 # skip any noise generated by remote shell |
93 self._callstream("hello") | 95 self._callstream("hello") |
94 r = self._callstream("between", pairs=("%s-%s" % ("0"*40, "0"*40))) | 96 r = self._callstream("between", pairs=("%s-%s" % ("0"*40, "0"*40))) |
95 lines = ["", "dummy"] | 97 lines = ["", "dummy"] |