D2382: sshpeer: make pipe polling code more explicit

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Thu Feb 22 09:18:53 EST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG066e6a9d52bb: sshpeer: make pipe polling code more explicit (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2382?vs=5968&id=6000

REVISION DETAIL
  https://phab.mercurial-scm.org/D2382

AFFECTED FILES
  mercurial/sshpeer.py

CHANGE DETAILS

diff --git a/mercurial/sshpeer.py b/mercurial/sshpeer.py
--- a/mercurial/sshpeer.py
+++ b/mercurial/sshpeer.py
@@ -65,8 +65,11 @@
 
         (This will only wait for data if the setup is supported by `util.poll`)
         """
-        if getattr(self._main, 'hasbuffer', False): # getattr for classic pipe
-            return (True, True) # main has data, assume side is worth poking at.
+        if (isinstance(self._main, util.bufferedinputpipe) and
+            self._main.hasbuffer):
+            # Main has data. Assume side is worth poking at.
+            return True, True
+
         fds = [self._main.fileno(), self._side.fileno()]
         try:
             act = util.poll(fds)



To: indygreg, #hg-reviewers, yuja
Cc: mercurial-devel


More information about the Mercurial-devel mailing list