Patchwork D9669: engine: prevent multiple checking of re-delta-multibase

login
register
mail settings
Submitter phabricator
Date Dec. 30, 2020, 11:53 a.m.
Message ID <differential-rev-PHID-DREV-yjs6ohyalb73w2sd3gz6-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47980/
State Superseded
Headers show

Comments

phabricator - Dec. 30, 2020, 11:53 a.m.
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The _perform_clone function is called for each revlog cloned, hence we should
  prevent this function call overhead.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9669

AFFECTED FILES
  mercurial/upgrade_utils/actions.py
  mercurial/upgrade_utils/engine.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/upgrade_utils/engine.py b/mercurial/upgrade_utils/engine.py
--- a/mercurial/upgrade_utils/engine.py
+++ b/mercurial/upgrade_utils/engine.py
@@ -140,9 +140,7 @@ 
             newrl,
             addrevisioncb=oncopiedrevision,
             deltareuse=upgrade_op.delta_reuse_mode,
-            forcedeltabothparents=upgrade_op.has_upgrade_action(
-                b're-delta-multibase'
-            ),
+            forcedeltabothparents=upgrade_op.force_re_delta_both_parents,
             sidedatacompanion=sidedatacompanion,
         )
     else:
diff --git a/mercurial/upgrade_utils/actions.py b/mercurial/upgrade_utils/actions.py
--- a/mercurial/upgrade_utils/actions.py
+++ b/mercurial/upgrade_utils/actions.py
@@ -658,6 +658,11 @@ 
         elif b're-delta-fulladd' in self._upgrade_actions_names:
             self.delta_reuse_mode = revlog.revlog.DELTAREUSEFULLADD
 
+        # should this operation force re-delta of both parents
+        self.force_re_delta_both_parents = (
+            b're-delta-multibase' in self._upgrade_actions_names
+        )
+
     def _write_labeled(self, l, label):
         """
         Utility function to aid writing of a list under one label