comparison mercurial/upgrade_utils/actions.py @ 46215:82f3ee1a505f

actions: store deltareuse mode of whole operation in UpgradeOperation UpgradeOperation should provide easy access to all the things related to the current operation. Clients should not need to compute them. Differential Revision: https://phab.mercurial-scm.org/D9666
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 30 Dec 2020 16:20:25 +0530
parents 30310886d423
children 3f92a9bb80f0
comparison
equal deleted inserted replaced
46214:5dfa837d933e 46215:82f3ee1a505f
10 from ..i18n import _ 10 from ..i18n import _
11 from .. import ( 11 from .. import (
12 error, 12 error,
13 localrepo, 13 localrepo,
14 requirements, 14 requirements,
15 revlog,
15 util, 16 util,
16 ) 17 )
17 18
18 from ..utils import compression 19 from ..utils import compression
19 20
644 all_optimizations = findoptimizations(None) 645 all_optimizations = findoptimizations(None)
645 self.unused_optimizations = [ 646 self.unused_optimizations = [
646 i for i in all_optimizations if i not in self.upgrade_actions 647 i for i in all_optimizations if i not in self.upgrade_actions
647 ] 648 ]
648 649
650 # delta reuse mode of this upgrade operation
651 self.delta_reuse_mode = revlog.revlog.DELTAREUSEALWAYS
652 if b're-delta-all' in self._upgrade_actions_names:
653 self.delta_reuse_mode = revlog.revlog.DELTAREUSENEVER
654 elif b're-delta-parent' in self._upgrade_actions_names:
655 self.delta_reuse_mode = revlog.revlog.DELTAREUSESAMEREVS
656 elif b're-delta-multibase' in self._upgrade_actions_names:
657 self.delta_reuse_mode = revlog.revlog.DELTAREUSESAMEREVS
658 elif b're-delta-fulladd' in self._upgrade_actions_names:
659 self.delta_reuse_mode = revlog.revlog.DELTAREUSEFULLADD
660
649 def _write_labeled(self, l, label): 661 def _write_labeled(self, l, label):
650 """ 662 """
651 Utility function to aid writing of a list under one label 663 Utility function to aid writing of a list under one label
652 """ 664 """
653 first = True 665 first = True