Mercurial > public > mercurial-scm > hg
comparison mercurial/upgrade_utils/engine.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 | 5dfa837d933e |
children | 34efa84a43a1 |
comparison
equal
deleted
inserted
replaced
46214:5dfa837d933e | 46215:82f3ee1a505f |
---|---|
444 b'(it is safe to interrupt this process any time before ' | 444 b'(it is safe to interrupt this process any time before ' |
445 b'data migration completes)\n' | 445 b'data migration completes)\n' |
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 ) |
470 | 459 |
471 # Now copy other files in the store directory. | 460 # Now copy other files in the store directory. |