repo-upgrade: keep the revlog open while cloning
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 25 Sep 2023 16:36:17 +0200
changeset 51016 aed91a4421b8
parent 51015 812cd3dfa4cb
child 51017 edc44ab7437a
repo-upgrade: keep the revlog open while cloning This is more explicit. No performance differences were observed.
mercurial/revlog.py
--- a/mercurial/revlog.py	Mon Sep 25 12:37:52 2023 +0200
+++ b/mercurial/revlog.py	Mon Sep 25 16:36:17 2023 +0200
@@ -3218,14 +3218,15 @@
 
             destrevlog._deltabothparents = forcedeltabothparents or oldamd
 
-            self._clone(
-                tr,
-                destrevlog,
-                addrevisioncb,
-                deltareuse,
-                forcedeltabothparents,
-                sidedata_helpers,
-            )
+            with self.reading():
+                self._clone(
+                    tr,
+                    destrevlog,
+                    addrevisioncb,
+                    deltareuse,
+                    forcedeltabothparents,
+                    sidedata_helpers,
+                )
 
         finally:
             destrevlog._lazydelta = oldlazydelta