##// END OF EJS Templates
actions: store deltareuse mode of whole operation in UpgradeOperation...
Pulkit Goyal -
r46832:82f3ee1a default
parent child Browse files
Show More
@@ -12,6 +12,7 b' from .. import ('
12 error,
12 error,
13 localrepo,
13 localrepo,
14 requirements,
14 requirements,
15 revlog,
15 util,
16 util,
16 )
17 )
17
18
@@ -646,6 +647,17 b' class UpgradeOperation(object):'
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
@@ -446,24 +446,13 b' def upgrade(ui, srcrepo, dstrepo, upgrad'
446 )
446 )
447 )
447 )
448
448
449 if upgrade_op.has_upgrade_action(b're-delta-all'):
450 deltareuse = revlog.revlog.DELTAREUSENEVER
451 elif upgrade_op.has_upgrade_action(b're-delta-parent'):
452 deltareuse = revlog.revlog.DELTAREUSESAMEREVS
453 elif upgrade_op.has_upgrade_action(b're-delta-multibase'):
454 deltareuse = revlog.revlog.DELTAREUSESAMEREVS
455 elif upgrade_op.has_upgrade_action(b're-delta-fulladd'):
456 deltareuse = revlog.revlog.DELTAREUSEFULLADD
457 else:
458 deltareuse = revlog.revlog.DELTAREUSEALWAYS
459
460 with dstrepo.transaction(b'upgrade') as tr:
449 with dstrepo.transaction(b'upgrade') as tr:
461 _clonerevlogs(
450 _clonerevlogs(
462 ui,
451 ui,
463 srcrepo,
452 srcrepo,
464 dstrepo,
453 dstrepo,
465 tr,
454 tr,
466 deltareuse,
455 upgrade_op.delta_reuse_mode,
467 upgrade_op.has_upgrade_action(b're-delta-multibase'),
456 upgrade_op.has_upgrade_action(b're-delta-multibase'),
468 revlogs=upgrade_op.revlogs_to_process,
457 revlogs=upgrade_op.revlogs_to_process,
469 )
458 )
General Comments 0
You need to be logged in to leave comments. Login now