# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1609326575 -19800 # Node ID 3f92a9bb80f053d2dee2dbde97da2fa0b6cbc4d8 # Parent 02df91e895bdc637aaf674e33576b810caa675f5 engine: prevent multiple checking of re-delta-multibase The _perform_clone function is called for each revlog cloned, hence we should prevent this function call overhead. Differential Revision: https://phab.mercurial-scm.org/D9669 diff -r 02df91e895bd -r 3f92a9bb80f0 mercurial/upgrade_utils/actions.py --- a/mercurial/upgrade_utils/actions.py Wed Dec 30 16:33:49 2020 +0530 +++ b/mercurial/upgrade_utils/actions.py Wed Dec 30 16:39:35 2020 +0530 @@ -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 diff -r 02df91e895bd -r 3f92a9bb80f0 mercurial/upgrade_utils/engine.py --- a/mercurial/upgrade_utils/engine.py Wed Dec 30 16:33:49 2020 +0530 +++ b/mercurial/upgrade_utils/engine.py Wed Dec 30 16:39:35 2020 +0530 @@ -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: