Show More
@@ -2848,6 +2848,7 b' def debugupdatecaches(ui, repo, *pats, *' | |||||
2848 | ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')), |
|
2848 | ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')), | |
2849 | ('', 'run', False, _('performs an upgrade')), |
|
2849 | ('', 'run', False, _('performs an upgrade')), | |
2850 | ('', 'backup', True, _('keep the old repository content around')), |
|
2850 | ('', 'backup', True, _('keep the old repository content around')), | |
|
2851 | ('', 'changelog', None, _('select the changelog for upgrade')), | |||
2851 | ('', 'manifest', None, _('select the manifest for upgrade')), |
|
2852 | ('', 'manifest', None, _('select the manifest for upgrade')), | |
2852 | ]) |
|
2853 | ]) | |
2853 | def debugupgraderepo(ui, repo, run=False, optimize=None, backup=True, **opts): |
|
2854 | def debugupgraderepo(ui, repo, run=False, optimize=None, backup=True, **opts): | |
@@ -2874,6 +2875,8 b' def debugupgraderepo(ui, repo, run=False' | |||||
2874 |
|
2875 | |||
2875 | * `--manifest`: only optimize the manifest |
|
2876 | * `--manifest`: only optimize the manifest | |
2876 | * `--no-manifest`: optimize all revlog but the manifest |
|
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 | return upgrade.upgraderepo(ui, repo, run=run, optimize=optimize, |
|
2881 | return upgrade.upgraderepo(ui, repo, run=run, optimize=optimize, | |
2879 | backup=backup, **opts) |
|
2882 | backup=backup, **opts) |
@@ -865,7 +865,7 b' def _upgraderepo(ui, srcrepo, dstrepo, r' | |||||
865 | return backuppath |
|
865 | return backuppath | |
866 |
|
866 | |||
867 | def upgraderepo(ui, repo, run=False, optimize=None, backup=True, |
|
867 | def upgraderepo(ui, repo, run=False, optimize=None, backup=True, | |
868 | manifest=None): |
|
868 | manifest=None, changelog=None): | |
869 | """Upgrade a repository in place.""" |
|
869 | """Upgrade a repository in place.""" | |
870 | if optimize is None: |
|
870 | if optimize is None: | |
871 | optimize = [] |
|
871 | optimize = [] | |
@@ -873,7 +873,7 b' def upgraderepo(ui, repo, run=False, opt' | |||||
873 | repo = repo.unfiltered() |
|
873 | repo = repo.unfiltered() | |
874 |
|
874 | |||
875 | revlogs = set(UPGRADE_ALL_REVLOGS) |
|
875 | revlogs = set(UPGRADE_ALL_REVLOGS) | |
876 |
specentries = (('m', manifest) |
|
876 | specentries = (('c', changelog), ('m', manifest)) | |
877 | specified = [(y, x) for (y, x) in specentries if x is not None] |
|
877 | specified = [(y, x) for (y, x) in specentries if x is not None] | |
878 | if specified: |
|
878 | if specified: | |
879 | # we have some limitation on revlogs to be recloned |
|
879 | # we have some limitation on revlogs to be recloned | |
@@ -881,12 +881,16 b' def upgraderepo(ui, repo, run=False, opt' | |||||
881 | revlogs = set() |
|
881 | revlogs = set() | |
882 | for r, enabled in specified: |
|
882 | for r, enabled in specified: | |
883 | if enabled: |
|
883 | if enabled: | |
884 |
if r == ' |
|
884 | if r == 'c': | |
|
885 | revlogs.add(UPGRADE_CHANGELOG) | |||
|
886 | elif r == 'm': | |||
885 | revlogs.add(UPGRADE_MANIFEST) |
|
887 | revlogs.add(UPGRADE_MANIFEST) | |
886 | else: |
|
888 | else: | |
887 | # none are enabled |
|
889 | # none are enabled | |
888 | for r, __ in specified: |
|
890 | for r, __ in specified: | |
889 |
if r == ' |
|
891 | if r == 'c': | |
|
892 | revlogs.discard(UPGRADE_CHANGELOG) | |||
|
893 | elif r == 'm': | |||
890 | revlogs.discard(UPGRADE_MANIFEST) |
|
894 | revlogs.discard(UPGRADE_MANIFEST) | |
891 |
|
895 | |||
892 | # Ensure the repository can be upgraded. |
|
896 | # Ensure the repository can be upgraded. |
@@ -312,7 +312,7 b' Show all commands + options' | |||||
312 | debuguigetpass: prompt |
|
312 | debuguigetpass: prompt | |
313 | debuguiprompt: prompt |
|
313 | debuguiprompt: prompt | |
314 | debugupdatecaches: |
|
314 | debugupdatecaches: | |
315 | debugupgraderepo: optimize, run, backup, manifest |
|
315 | debugupgraderepo: optimize, run, backup, changelog, manifest | |
316 | debugwalk: include, exclude |
|
316 | debugwalk: include, exclude | |
317 | debugwhyunstable: |
|
317 | debugwhyunstable: | |
318 | debugwireargs: three, four, five, ssh, remotecmd, insecure |
|
318 | debugwireargs: three, four, five, ssh, remotecmd, insecure |
@@ -636,6 +636,98 b' Check we can select negatively' | |||||
636 | checking files |
|
636 | checking files | |
637 | checked 3 changesets with 3 changes to 3 files |
|
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 | $ cd .. |
|
731 | $ cd .. | |
640 |
|
732 | |||
641 | store files with special filenames aren't encoded during copy |
|
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