Patchwork D9995: sshpeer: make sshpeer.close() close the underlying connection

login
register
mail settings
Submitter phabricator
Date Feb. 15, 2021, 9:42 p.m.
Message ID <differential-rev-PHID-DREV-6zarf7uqm5hrlk46sps5-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48310/
State New
Headers show

Comments

phabricator - Feb. 15, 2021, 9:42 p.m.
valentin.gatienbaron created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  So the connection can be closed eagerly in future commits, instead of
  relying on __del__.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/sshpeer.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/sshpeer.py b/mercurial/sshpeer.py
--- a/mercurial/sshpeer.py
+++ b/mercurial/sshpeer.py
@@ -434,7 +434,7 @@ 
         return True
 
     def close(self):
-        pass
+        self._cleanup()
 
     # End of ipeerconnection interface.