mercurial/bundlerepo.py
changeset 51017 3470a39fb66b
parent 50951 d718eddf01d9
child 51031 8520db304f01
--- a/mercurial/bundlerepo.py	Mon Sep 25 12:07:25 2023 +0200
+++ b/mercurial/bundlerepo.py	Mon Sep 25 12:13:38 2023 +0200
@@ -12,6 +12,7 @@
 """
 
 
+import contextlib
 import os
 import shutil
 
@@ -108,6 +109,14 @@
             self.bundlerevs.add(n)
             n += 1
 
+    @contextlib.contextmanager
+    def reading(self):
+        if self.repotiprev < 0:
+            yield
+        else:
+            with super().reading() as x:
+                yield x
+
     def _chunk(self, rev, df=None):
         # Warning: in case of bundle, the diff is against what we stored as
         # delta base, not against rev - 1