engine: pass upgrade operation inside `_perform_clone()`
authorPulkit Goyal <7895pulkit@gmail.com>
Wed, 30 Dec 2020 16:33:49 +0530
changeset 46217 02df91e895bd
parent 46216 34efa84a43a1
child 46218 3f92a9bb80f0
engine: pass upgrade operation inside `_perform_clone()` Same as previous patch. Differential Revision: https://phab.mercurial-scm.org/D9668
mercurial/upgrade_utils/engine.py
--- a/mercurial/upgrade_utils/engine.py	Wed Dec 30 16:29:33 2020 +0530
+++ b/mercurial/upgrade_utils/engine.py	Wed Dec 30 16:33:49 2020 +0530
@@ -124,15 +124,13 @@
     tr,
     old_revlog,
     unencoded,
-    deltareuse,
-    forcedeltabothparents,
-    revlogs,
+    upgrade_op,
     sidedatacompanion,
     oncopiedrevision,
 ):
     """ returns the new revlog object created"""
     newrl = None
-    if matchrevlog(revlogs, unencoded):
+    if matchrevlog(upgrade_op.revlogs_to_process, unencoded):
         ui.note(
             _(b'cloning %d revisions from %s\n') % (len(old_revlog), unencoded)
         )
@@ -141,8 +139,10 @@
             tr,
             newrl,
             addrevisioncb=oncopiedrevision,
-            deltareuse=deltareuse,
-            forcedeltabothparents=forcedeltabothparents,
+            deltareuse=upgrade_op.delta_reuse_mode,
+            forcedeltabothparents=upgrade_op.has_upgrade_action(
+                b're-delta-multibase'
+            ),
             sidedatacompanion=sidedatacompanion,
         )
     else:
@@ -276,9 +276,7 @@
             tr,
             oldrl,
             unencoded,
-            upgrade_op.delta_reuse_mode,
-            upgrade_op.has_upgrade_action(b're-delta-multibase'),
-            upgrade_op.revlogs_to_process,
+            upgrade_op,
             sidedatacompanion,
             oncopiedrevision,
         )
@@ -317,9 +315,7 @@
             tr,
             oldrl,
             unencoded,
-            upgrade_op.delta_reuse_mode,
-            upgrade_op.has_upgrade_action(b're-delta-multibase'),
-            upgrade_op.revlogs_to_process,
+            upgrade_op,
             sidedatacompanion,
             oncopiedrevision,
         )
@@ -357,9 +353,7 @@
             tr,
             oldrl,
             unencoded,
-            upgrade_op.delta_reuse_mode,
-            upgrade_op.has_upgrade_action(b're-delta-multibase'),
-            upgrade_op.revlogs_to_process,
+            upgrade_op,
             sidedatacompanion,
             oncopiedrevision,
         )