Show More
@@ -28,6 +28,12 b' from .utils import (' | |||
|
28 | 28 | compression, |
|
29 | 29 | ) |
|
30 | 30 | |
|
31 | # list of requirements that request a clone of all revlog if added/removed | |
|
32 | RECLONES_REQUIREMENTS = { | |
|
33 | 'generaldelta', | |
|
34 | localrepo.SPARSEREVLOG_REQUIREMENT, | |
|
35 | } | |
|
36 | ||
|
31 | 37 | def requiredsourcerequirements(repo): |
|
32 | 38 | """Obtain requirements required to be present to upgrade a repo. |
|
33 | 39 | |
@@ -952,6 +958,17 b' def upgraderepo(ui, repo, run=False, opt' | |||
|
952 | 958 | # determineactions could have added optimisation |
|
953 | 959 | if o not in actions) |
|
954 | 960 | |
|
961 | removedreqs = repo.requirements - newreqs | |
|
962 | addedreqs = newreqs - repo.requirements | |
|
963 | ||
|
964 | if revlogs != UPGRADE_ALL_REVLOGS: | |
|
965 | incompatible = RECLONES_REQUIREMENTS & (removedreqs | addedreqs) | |
|
966 | if incompatible: | |
|
967 | msg = _('ignoring revlogs selection flags, format requirements ' | |
|
968 | 'change: %s\n') | |
|
969 | ui.warn(msg % ', '.join(sorted(incompatible))) | |
|
970 | revlogs = UPGRADE_ALL_REVLOGS | |
|
971 | ||
|
955 | 972 | def printrequirements(): |
|
956 | 973 | ui.write(_('requirements\n')) |
|
957 | 974 | ui.write(_(' preserved: %s\n') % |
@@ -728,6 +728,109 b' Check that we can select filelog only' | |||
|
728 | 728 | checking files |
|
729 | 729 | checked 3 changesets with 3 changes to 3 files |
|
730 | 730 | |
|
731 | ||
|
732 | Check you can't skip revlog clone during important format downgrade | |
|
733 | ||
|
734 | $ echo "[format]" > .hg/hgrc | |
|
735 | $ echo "sparse-revlog=no" >> .hg/hgrc | |
|
736 | $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback | |
|
737 | ignoring revlogs selection flags, format requirements change: sparserevlog | |
|
738 | upgrade will perform the following actions: | |
|
739 | ||
|
740 | requirements | |
|
741 | preserved: dotencode, fncache, generaldelta, revlogv1, store | |
|
742 | removed: sparserevlog | |
|
743 | ||
|
744 | re-delta-parent | |
|
745 | deltas within internal storage will choose a new base revision if needed | |
|
746 | ||
|
747 | beginning upgrade... | |
|
748 | repository locked and read-only | |
|
749 | creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob) | |
|
750 | (it is safe to interrupt this process any time before data migration completes) | |
|
751 | migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog) | |
|
752 | migrating 917 bytes in store; 401 bytes tracked data | |
|
753 | migrating 3 filelogs containing 3 revisions (192 bytes in store; 0 bytes tracked data) | |
|
754 | cloning 1 revisions from data/f0.i | |
|
755 | cloning 1 revisions from data/f1.i | |
|
756 | cloning 1 revisions from data/f2.i | |
|
757 | finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes | |
|
758 | migrating 1 manifests containing 3 revisions (349 bytes in store; 220 bytes tracked data) | |
|
759 | cloning 3 revisions from 00manifest.i | |
|
760 | finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes | |
|
761 | migrating changelog containing 3 revisions (376 bytes in store; 181 bytes tracked data) | |
|
762 | cloning 3 revisions from 00changelog.i | |
|
763 | finished migrating 3 changelog revisions; change in size: 0 bytes | |
|
764 | finished migrating 9 total revisions; total change in store size: 0 bytes | |
|
765 | copying phaseroots | |
|
766 | data fully migrated to temporary repository | |
|
767 | marking source repository as being upgraded; clients will be unable to read from repository | |
|
768 | starting in-place swap of repository data | |
|
769 | replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob) | |
|
770 | replacing store... | |
|
771 | store replacement complete; repository was inconsistent for *s (glob) | |
|
772 | finalizing requirements file and making repository readable again | |
|
773 | removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob) | |
|
774 | removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob) | |
|
775 | $ hg verify | |
|
776 | checking changesets | |
|
777 | checking manifests | |
|
778 | crosschecking files in changesets and manifests | |
|
779 | checking files | |
|
780 | checked 3 changesets with 3 changes to 3 files | |
|
781 | ||
|
782 | Check you can't skip revlog clone during important format upgrade | |
|
783 | ||
|
784 | $ echo "sparse-revlog=yes" >> .hg/hgrc | |
|
785 | $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback | |
|
786 | ignoring revlogs selection flags, format requirements change: sparserevlog | |
|
787 | upgrade will perform the following actions: | |
|
788 | ||
|
789 | requirements | |
|
790 | preserved: dotencode, fncache, generaldelta, revlogv1, store | |
|
791 | added: sparserevlog | |
|
792 | ||
|
793 | sparserevlog | |
|
794 | Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server. | |
|
795 | ||
|
796 | re-delta-parent | |
|
797 | deltas within internal storage will choose a new base revision if needed | |
|
798 | ||
|
799 | beginning upgrade... | |
|
800 | repository locked and read-only | |
|
801 | creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob) | |
|
802 | (it is safe to interrupt this process any time before data migration completes) | |
|
803 | migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog) | |
|
804 | migrating 917 bytes in store; 401 bytes tracked data | |
|
805 | migrating 3 filelogs containing 3 revisions (192 bytes in store; 0 bytes tracked data) | |
|
806 | cloning 1 revisions from data/f0.i | |
|
807 | cloning 1 revisions from data/f1.i | |
|
808 | cloning 1 revisions from data/f2.i | |
|
809 | finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes | |
|
810 | migrating 1 manifests containing 3 revisions (349 bytes in store; 220 bytes tracked data) | |
|
811 | cloning 3 revisions from 00manifest.i | |
|
812 | finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes | |
|
813 | migrating changelog containing 3 revisions (376 bytes in store; 181 bytes tracked data) | |
|
814 | cloning 3 revisions from 00changelog.i | |
|
815 | finished migrating 3 changelog revisions; change in size: 0 bytes | |
|
816 | finished migrating 9 total revisions; total change in store size: 0 bytes | |
|
817 | copying phaseroots | |
|
818 | data fully migrated to temporary repository | |
|
819 | marking source repository as being upgraded; clients will be unable to read from repository | |
|
820 | starting in-place swap of repository data | |
|
821 | replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob) | |
|
822 | replacing store... | |
|
823 | store replacement complete; repository was inconsistent for *s (glob) | |
|
824 | finalizing requirements file and making repository readable again | |
|
825 | removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob) | |
|
826 | removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob) | |
|
827 | $ hg verify | |
|
828 | checking changesets | |
|
829 | checking manifests | |
|
830 | crosschecking files in changesets and manifests | |
|
831 | checking files | |
|
832 | checked 3 changesets with 3 changes to 3 files | |
|
833 | ||
|
731 | 834 | $ cd .. |
|
732 | 835 | |
|
733 | 836 | store files with special filenames aren't encoded during copy |
General Comments 0
You need to be logged in to leave comments.
Login now