changeset 51016:aed91a4421b8

repo-upgrade: keep the revlog open while cloning This is more explicit. No performance differences were observed.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 25 Sep 2023 16:36:17 +0200
parents 812cd3dfa4cb
children edc44ab7437a
files mercurial/revlog.py
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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