comparison tests/test-persistent-nodemap.t @ 46472:98e39f04d60e

upgrade: implement partial upgrade for upgrading persistent-nodemap Upgrading repositories to use persistent nodemap should be fast and easy as it requires only two things: 1) Updating the requirements 2) Writing a persistent-nodemap on disk For both of the steps above, we don't need to edit existing revlogs. This patch makes upgrade only do the above mentioned two steps if we are only upgarding to use persistent-nodemap feature. Since `nodemap.persist_nodemap()` assumes that there exists a nodemap file for the given revlog if we are trying to call it, this patch adds `force` argument to create a file if does not exist which is true in our upgrade case. The test changes demonstrate that we no longer write nodemap files for manifest after upgrade which I think is desirable. Differential Revision: https://phab.mercurial-scm.org/D9936
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 01 Feb 2021 00:02:00 +0530
parents bfaacfa8ebfc
children 636853347e14
comparison
equal deleted inserted replaced
46471:bfaacfa8ebfc 46472:98e39f04d60e
634 634
635 beginning upgrade... 635 beginning upgrade...
636 repository locked and read-only 636 repository locked and read-only
637 creating temporary repository to stage upgraded data: $TESTTMP/test-repo/.hg/upgrade.* (glob) 637 creating temporary repository to stage upgraded data: $TESTTMP/test-repo/.hg/upgrade.* (glob)
638 (it is safe to interrupt this process any time before data migration completes) 638 (it is safe to interrupt this process any time before data migration completes)
639 migrating 15018 total revisions (5006 in filelogs, 5006 in manifests, 5006 in changelog) 639 upgrading repository to use persistent nodemap feature
640 migrating 1.74 MB in store; 569 MB tracked data
641 migrating 5004 filelogs containing 5006 revisions (346 KB in store; 28.2 KB tracked data)
642 finished migrating 5006 filelog revisions across 5004 filelogs; change in size: 0 bytes
643 migrating 1 manifests containing 5006 revisions (765 KB in store; 569 MB tracked data)
644 finished migrating 5006 manifest revisions across 1 manifests; change in size: 0 bytes
645 migrating changelog containing 5006 revisions (673 KB in store; 363 KB tracked data)
646 finished migrating 5006 changelog revisions; change in size: 0 bytes
647 finished migrating 15018 total revisions; total change in store size: 0 bytes
648 copying phaseroots
649 data fully upgraded in a temporary repository
650 marking source repository as being upgraded; clients will be unable to read from repository
651 starting in-place swap of repository data
652 replacing store...
653 store replacement complete; repository was inconsistent for *s (glob)
654 finalizing requirements file and making repository readable again
655 removing temporary repository $TESTTMP/test-repo/.hg/upgrade.* (glob) 640 removing temporary repository $TESTTMP/test-repo/.hg/upgrade.* (glob)
656 $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' 641 $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
657 00changelog-*.nd (glob) 642 00changelog-*.nd (glob)
658 00changelog.n 643 00changelog.n
659 00manifest-*.nd (glob)
660 00manifest.n
661 644
662 $ hg debugnodemap --metadata 645 $ hg debugnodemap --metadata
663 uid: * (glob) 646 uid: * (glob)
664 tip-rev: 5005 647 tip-rev: 5005
665 tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe 648 tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe