engine: pass upgrade operation inside _clonerevlogs()
authorPulkit Goyal <7895pulkit@gmail.com>
Wed, 30 Dec 2020 16:29:33 +0530
changeset 46216 34efa84a43a1
parent 46215 82f3ee1a505f
child 46217 02df91e895bd
engine: pass upgrade operation inside _clonerevlogs() Better to pass the operation instead of passing three of it's members (one of the them is a function call) separately. This will also be useful in future when we will like to control which things are upgraded. Differential Revision: https://phab.mercurial-scm.org/D9667
mercurial/upgrade_utils/engine.py
--- a/mercurial/upgrade_utils/engine.py	Wed Dec 30 16:20:25 2020 +0530
+++ b/mercurial/upgrade_utils/engine.py	Wed Dec 30 16:29:33 2020 +0530
@@ -159,9 +159,7 @@
     srcrepo,
     dstrepo,
     tr,
-    deltareuse,
-    forcedeltabothparents,
-    revlogs=UPGRADE_ALL_REVLOGS,
+    upgrade_op,
 ):
     """Copy revlogs between 2 repos."""
     revcount = 0
@@ -278,9 +276,9 @@
             tr,
             oldrl,
             unencoded,
-            deltareuse,
-            forcedeltabothparents,
-            revlogs,
+            upgrade_op.delta_reuse_mode,
+            upgrade_op.has_upgrade_action(b're-delta-multibase'),
+            upgrade_op.revlogs_to_process,
             sidedatacompanion,
             oncopiedrevision,
         )
@@ -319,9 +317,9 @@
             tr,
             oldrl,
             unencoded,
-            deltareuse,
-            forcedeltabothparents,
-            revlogs,
+            upgrade_op.delta_reuse_mode,
+            upgrade_op.has_upgrade_action(b're-delta-multibase'),
+            upgrade_op.revlogs_to_process,
             sidedatacompanion,
             oncopiedrevision,
         )
@@ -359,9 +357,9 @@
             tr,
             oldrl,
             unencoded,
-            deltareuse,
-            forcedeltabothparents,
-            revlogs,
+            upgrade_op.delta_reuse_mode,
+            upgrade_op.has_upgrade_action(b're-delta-multibase'),
+            upgrade_op.revlogs_to_process,
             sidedatacompanion,
             oncopiedrevision,
         )
@@ -452,9 +450,7 @@
             srcrepo,
             dstrepo,
             tr,
-            upgrade_op.delta_reuse_mode,
-            upgrade_op.has_upgrade_action(b're-delta-multibase'),
-            revlogs=upgrade_op.revlogs_to_process,
+            upgrade_op,
         )
 
     # Now copy other files in the store directory.