From patchwork Mon Feb 15 21:42:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D9996: sshpeer: add a method to check if a doublepipe is closed From: phabricator X-Patchwork-Id: 48312 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Mon, 15 Feb 2021 21:42:36 +0000 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 To: valentin.gatienbaron, #hg-reviewers Cc: mercurial-patches, mercurial-devel 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()