mercurial/changelog.py
changeset 36001 fa15a70f88de
parent 35672 5a6e0eee7781
child 36002 69aaad59dc02
--- a/mercurial/changelog.py	Sun Feb 04 00:29:22 2018 +0100
+++ b/mercurial/changelog.py	Mon Feb 05 20:36:51 2018 +0100
@@ -127,6 +127,13 @@
         self.offset += len(s)
         self._end += len(s)
 
+    def __enter__(self):
+        self.fp.__enter__()
+        return self
+
+    def __exit__(self, *args):
+        return self.fp.__exit__(*args)
+
 def _divertopener(opener, target):
     """build an opener that writes in 'target.a' instead of 'target'"""
     def _divert(name, mode='r', checkambig=False):