mercurial/httpconnection.py
changeset 30142 3dcaf1c4e90d
parent 29250 d6b9468eebee
child 31299 90e69badb125
--- a/mercurial/httpconnection.py	Sat Oct 08 00:59:40 2016 +0200
+++ b/mercurial/httpconnection.py	Sat Oct 08 00:59:41 2016 +0200
@@ -58,6 +58,12 @@
                          unit=_('kb'), total=self._total)
         return ret
 
+    def __enter__(self):
+        return self
+
+    def __exit__(self, exc_type, exc_val, exc_tb):
+        self.close()
+
 # moved here from url.py to avoid a cycle
 def readauthforuri(ui, uri, user):
     # Read configuration