mercurial/revlog.py
changeset 47463 5fa083a5ff04
parent 47457 f8330a3fc39f
child 47465 bc8536e09a20
--- a/mercurial/revlog.py	Tue Jun 22 13:18:29 2021 -0400
+++ b/mercurial/revlog.py	Thu Jun 17 19:48:25 2021 +0200
@@ -2086,6 +2086,13 @@
         """called when trying to add a node already stored."""
 
     @contextlib.contextmanager
+    def reading(self):
+        """Context manager that keeps data and sidedata files open for reading"""
+        with self._segmentfile.reading():
+            with self._segmentfile_sidedata.reading():
+                yield
+
+    @contextlib.contextmanager
     def _writing(self, transaction):
         if self._trypending:
             msg = b'try to write in a `trypending` revlog: %s'