D9996: sshpeer: add a method to check if a doublepipe is closed

valentin.gatienbaron (Valentin Gatien-Baron) phabricator at mercurial-scm.org
Mon Feb 15 21:42:36 UTC 2021


valentin.gatienbaron created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  So we can tell in a next commit if we're trying to close an already
  closed connection or not (in which case, we may warn).

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/sshpeer.py
  tests/test-check-interfaces.py

CHANGE DETAILS

diff --git a/tests/test-check-interfaces.py b/tests/test-check-interfaces.py
--- a/tests/test-check-interfaces.py
+++ b/tests/test-check-interfaces.py
@@ -113,6 +113,10 @@
     def close(self):
         pass
 
+    @property
+    def closed(self):
+        pass
+
 
 def main():
     ui = uimod.ui()
diff --git a/mercurial/sshpeer.py b/mercurial/sshpeer.py
--- a/mercurial/sshpeer.py
+++ b/mercurial/sshpeer.py
@@ -140,6 +140,10 @@
     def close(self):
         return self._main.close()
 
+    @property
+    def closed(self):
+        return self._main.closed
+
     def flush(self):
         return self._main.flush()
 



To: valentin.gatienbaron, #hg-reviewers
Cc: mercurial-patches, mercurial-devel


More information about the Mercurial-devel mailing list