##// END OF EJS Templates
upgrade: add an argument to control changelog upgrade...
marmoute -
r43099:908ff446 default
parent child Browse files
Show More
@@ -2848,6 +2848,7 def debugupdatecaches(ui, repo, *pats, *
2848 2848 ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')),
2849 2849 ('', 'run', False, _('performs an upgrade')),
2850 2850 ('', 'backup', True, _('keep the old repository content around')),
2851 ('', 'changelog', None, _('select the changelog for upgrade')),
2851 2852 ('', 'manifest', None, _('select the manifest for upgrade')),
2852 2853 ])
2853 2854 def debugupgraderepo(ui, repo, run=False, optimize=None, backup=True, **opts):
@@ -2874,6 +2875,8 def debugupgraderepo(ui, repo, run=False
2874 2875
2875 2876 * `--manifest`: only optimize the manifest
2876 2877 * `--no-manifest`: optimize all revlog but the manifest
2878 * `--changelog`: optimize the changelog only
2879 * `--no-changelog --no-manifest`: optimize filelogs only
2877 2880 """
2878 2881 return upgrade.upgraderepo(ui, repo, run=run, optimize=optimize,
2879 2882 backup=backup, **opts)
@@ -865,7 +865,7 def _upgraderepo(ui, srcrepo, dstrepo, r
865 865 return backuppath
866 866
867 867 def upgraderepo(ui, repo, run=False, optimize=None, backup=True,
868 manifest=None):
868 manifest=None, changelog=None):
869 869 """Upgrade a repository in place."""
870 870 if optimize is None:
871 871 optimize = []
@@ -873,7 +873,7 def upgraderepo(ui, repo, run=False, opt
873 873 repo = repo.unfiltered()
874 874
875 875 revlogs = set(UPGRADE_ALL_REVLOGS)
876 specentries = (('m', manifest),)
876 specentries = (('c', changelog), ('m', manifest))
877 877 specified = [(y, x) for (y, x) in specentries if x is not None]
878 878 if specified:
879 879 # we have some limitation on revlogs to be recloned
@@ -881,12 +881,16 def upgraderepo(ui, repo, run=False, opt
881 881 revlogs = set()
882 882 for r, enabled in specified:
883 883 if enabled:
884 if r == 'm':
884 if r == 'c':
885 revlogs.add(UPGRADE_CHANGELOG)
886 elif r == 'm':
885 887 revlogs.add(UPGRADE_MANIFEST)
886 888 else:
887 889 # none are enabled
888 890 for r, __ in specified:
889 if r == 'm':
891 if r == 'c':
892 revlogs.discard(UPGRADE_CHANGELOG)
893 elif r == 'm':
890 894 revlogs.discard(UPGRADE_MANIFEST)
891 895
892 896 # Ensure the repository can be upgraded.
@@ -312,7 +312,7 Show all commands + options
312 312 debuguigetpass: prompt
313 313 debuguiprompt: prompt
314 314 debugupdatecaches:
315 debugupgraderepo: optimize, run, backup, manifest
315 debugupgraderepo: optimize, run, backup, changelog, manifest
316 316 debugwalk: include, exclude
317 317 debugwhyunstable:
318 318 debugwireargs: three, four, five, ssh, remotecmd, insecure
@@ -636,6 +636,98 Check we can select negatively
636 636 checking files
637 637 checked 3 changesets with 3 changes to 3 files
638 638
639 Check that we can select changelog only
640
641 $ hg debugupgrade --optimize re-delta-parent --run --changelog --no-backup --debug --traceback
642 upgrade will perform the following actions:
643
644 requirements
645 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
646
647 re-delta-parent
648 deltas within internal storage will choose a new base revision if needed
649
650 beginning upgrade...
651 repository locked and read-only
652 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
653 (it is safe to interrupt this process any time before data migration completes)
654 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
655 migrating 917 bytes in store; 401 bytes tracked data
656 migrating 3 filelogs containing 3 revisions (192 bytes in store; 0 bytes tracked data)
657 blindly copying data/f0.i containing 1 revisions
658 blindly copying data/f1.i containing 1 revisions
659 blindly copying data/f2.i containing 1 revisions
660 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
661 migrating 1 manifests containing 3 revisions (349 bytes in store; 220 bytes tracked data)
662 blindly copying 00manifest.i containing 3 revisions
663 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
664 migrating changelog containing 3 revisions (376 bytes in store; 181 bytes tracked data)
665 cloning 3 revisions from 00changelog.i
666 finished migrating 3 changelog revisions; change in size: 0 bytes
667 finished migrating 9 total revisions; total change in store size: 0 bytes
668 copying phaseroots
669 data fully migrated to temporary repository
670 marking source repository as being upgraded; clients will be unable to read from repository
671 starting in-place swap of repository data
672 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
673 replacing store...
674 store replacement complete; repository was inconsistent for *s (glob)
675 finalizing requirements file and making repository readable again
676 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
677 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
678 $ hg verify
679 checking changesets
680 checking manifests
681 crosschecking files in changesets and manifests
682 checking files
683 checked 3 changesets with 3 changes to 3 files
684
685 Check that we can select filelog only
686
687 $ hg debugupgrade --optimize re-delta-parent --run --no-changelog --no-manifest --no-backup --debug --traceback
688 upgrade will perform the following actions:
689
690 requirements
691 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
692
693 re-delta-parent
694 deltas within internal storage will choose a new base revision if needed
695
696 beginning upgrade...
697 repository locked and read-only
698 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
699 (it is safe to interrupt this process any time before data migration completes)
700 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
701 migrating 917 bytes in store; 401 bytes tracked data
702 migrating 3 filelogs containing 3 revisions (192 bytes in store; 0 bytes tracked data)
703 cloning 1 revisions from data/f0.i
704 cloning 1 revisions from data/f1.i
705 cloning 1 revisions from data/f2.i
706 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
707 migrating 1 manifests containing 3 revisions (349 bytes in store; 220 bytes tracked data)
708 blindly copying 00manifest.i containing 3 revisions
709 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
710 migrating changelog containing 3 revisions (376 bytes in store; 181 bytes tracked data)
711 blindly copying 00changelog.i containing 3 revisions
712 finished migrating 3 changelog revisions; change in size: 0 bytes
713 finished migrating 9 total revisions; total change in store size: 0 bytes
714 copying phaseroots
715 data fully migrated to temporary repository
716 marking source repository as being upgraded; clients will be unable to read from repository
717 starting in-place swap of repository data
718 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
719 replacing store...
720 store replacement complete; repository was inconsistent for *s (glob)
721 finalizing requirements file and making repository readable again
722 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
723 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
724 $ hg verify
725 checking changesets
726 checking manifests
727 crosschecking files in changesets and manifests
728 checking files
729 checked 3 changesets with 3 changes to 3 files
730
639 731 $ cd ..
640 732
641 733 store files with special filenames aren't encoded during copy
General Comments 0
You need to be logged in to leave comments. Login now