sshpeer: allow doublepipe on unbuffered main pipe
authorPierre-Yves David <pierre-yves.david@fb.com>
Fri, 05 Jun 2015 04:54:23 -0700
changeset 25457 2afa748138e0
parent 25456 408b7979bf03
child 25458 4642f0b803ae
sshpeer: allow doublepipe on unbuffered main pipe The output pipe does not have manually managed read buffer (actually, no read anything). To also use the doublepipe for outgoing write (useful to consume remote output when pushing large set of data) we need the doublepipe to work on standard pipe too.
mercurial/sshpeer.py
--- a/mercurial/sshpeer.py	Wed May 20 10:58:29 2015 -0500
+++ b/mercurial/sshpeer.py	Fri Jun 05 04:54:23 2015 -0700
@@ -65,7 +65,7 @@
 
         (This will only wait for data if the setup is supported by `util.poll`)
         """
-        if self._main.hasbuffer:
+        if getattr(self._main, 'hasbuffer', False): # getattr for classic pipe
             return (True, True) # main has data, assume side is worth poking at.
         fds = [self._main.fileno(), self._side.fileno()]
         try: