Show More
@@ -1775,6 +1775,12 b' if rustmod is not None:' | |||
|
1775 | 1775 | # for consistent view between _pl() and _read() invocations |
|
1776 | 1776 | self._pendingmode = None |
|
1777 | 1777 | |
|
1778 | self._use_dirstate_tree = self._ui.configbool( | |
|
1779 | b"experimental", | |
|
1780 | b"dirstate-tree.in-memory", | |
|
1781 | False, | |
|
1782 | ) | |
|
1783 | ||
|
1778 | 1784 | def addfile(self, *args, **kwargs): |
|
1779 | 1785 | return self._rustmap.addfile(*args, **kwargs) |
|
1780 | 1786 | |
@@ -1903,13 +1909,8 b' if rustmod is not None:' | |||
|
1903 | 1909 | raise |
|
1904 | 1910 | st = b'' |
|
1905 | 1911 | |
|
1906 | use_dirstate_tree = self._ui.configbool( | |
|
1907 | b"experimental", | |
|
1908 | b"dirstate-tree.in-memory", | |
|
1909 | False, | |
|
1910 | ) | |
|
1911 | 1912 | self._rustmap, parents = rustmod.DirstateMap.new( |
|
1912 | use_dirstate_tree, self._use_dirstate_v2, st | |
|
1913 | self._use_dirstate_tree, self._use_dirstate_v2, st | |
|
1913 | 1914 | ) |
|
1914 | 1915 | |
|
1915 | 1916 | if parents and not self._dirtyparents: |
@@ -80,7 +80,7 b' class improvement(object):' | |||
|
80 | 80 | # operation in which this improvement was removed |
|
81 | 81 | postdowngrademessage = None |
|
82 | 82 | |
|
83 |
# By default |
|
|
83 | # By default we assume that every improvement touches requirements and all revlogs | |
|
84 | 84 | |
|
85 | 85 | # Whether this improvement touches filelogs |
|
86 | 86 | touches_filelogs = True |
@@ -94,6 +94,9 b' class improvement(object):' | |||
|
94 | 94 | # Whether this improvement changes repository requirements |
|
95 | 95 | touches_requirements = True |
|
96 | 96 | |
|
97 | # Whether this improvement touches the dirstate | |
|
98 | touches_dirstate = False | |
|
99 | ||
|
97 | 100 | |
|
98 | 101 | allformatvariant = [] # type: List[Type['formatvariant']] |
|
99 | 102 | |
@@ -167,6 +170,27 b' class fncache(requirementformatvariant):' | |||
|
167 | 170 | |
|
168 | 171 | |
|
169 | 172 | @registerformatvariant |
|
173 | class dirstatev2(requirementformatvariant): | |
|
174 | name = b'dirstate-v2' | |
|
175 | _requirement = requirements.DIRSTATE_V2_REQUIREMENT | |
|
176 | ||
|
177 | default = False | |
|
178 | ||
|
179 | description = _( | |
|
180 | b'version 1 of the dirstate file format requires ' | |
|
181 | b'reading and parsing it all at once.' | |
|
182 | ) | |
|
183 | ||
|
184 | upgrademessage = _(b'"hg status" will be faster') | |
|
185 | ||
|
186 | touches_filelogs = False | |
|
187 | touches_manifests = False | |
|
188 | touches_changelog = False | |
|
189 | touches_requirements = True | |
|
190 | touches_dirstate = True | |
|
191 | ||
|
192 | ||
|
193 | @registerformatvariant | |
|
170 | 194 | class dotencode(requirementformatvariant): |
|
171 | 195 | name = b'dotencode' |
|
172 | 196 | |
@@ -644,7 +668,6 b' class UpgradeOperation(object):' | |||
|
644 | 668 | self.current_requirements = current_requirements |
|
645 | 669 | # list of upgrade actions the operation will perform |
|
646 | 670 | self.upgrade_actions = upgrade_actions |
|
647 | self._upgrade_actions_names = set([a.name for a in upgrade_actions]) | |
|
648 | 671 | self.removed_actions = removed_actions |
|
649 | 672 | self.revlogs_to_process = revlogs_to_process |
|
650 | 673 | # requirements which will be added by the operation |
@@ -667,41 +690,42 b' class UpgradeOperation(object):' | |||
|
667 | 690 | ] |
|
668 | 691 | |
|
669 | 692 | # delta reuse mode of this upgrade operation |
|
693 | upgrade_actions_names = self.upgrade_actions_names | |
|
670 | 694 | self.delta_reuse_mode = revlog.revlog.DELTAREUSEALWAYS |
|
671 |
if b're-delta-all' in |
|
|
695 | if b're-delta-all' in upgrade_actions_names: | |
|
672 | 696 | self.delta_reuse_mode = revlog.revlog.DELTAREUSENEVER |
|
673 |
elif b're-delta-parent' in |
|
|
697 | elif b're-delta-parent' in upgrade_actions_names: | |
|
674 | 698 | self.delta_reuse_mode = revlog.revlog.DELTAREUSESAMEREVS |
|
675 |
elif b're-delta-multibase' in |
|
|
699 | elif b're-delta-multibase' in upgrade_actions_names: | |
|
676 | 700 | self.delta_reuse_mode = revlog.revlog.DELTAREUSESAMEREVS |
|
677 |
elif b're-delta-fulladd' in |
|
|
701 | elif b're-delta-fulladd' in upgrade_actions_names: | |
|
678 | 702 | self.delta_reuse_mode = revlog.revlog.DELTAREUSEFULLADD |
|
679 | 703 | |
|
680 | 704 | # should this operation force re-delta of both parents |
|
681 | 705 | self.force_re_delta_both_parents = ( |
|
682 |
b're-delta-multibase' in |
|
|
706 | b're-delta-multibase' in upgrade_actions_names | |
|
683 | 707 | ) |
|
684 | 708 | |
|
685 | 709 | # should this operation create a backup of the store |
|
686 | 710 | self.backup_store = backup_store |
|
687 | 711 | |
|
688 | # whether the operation touches different revlogs at all or not | |
|
689 | self.touches_filelogs = self._touches_filelogs() | |
|
690 | self.touches_manifests = self._touches_manifests() | |
|
691 | self.touches_changelog = self._touches_changelog() | |
|
692 | # whether the operation touches requirements file or not | |
|
693 | self.touches_requirements = self._touches_requirements() | |
|
694 | self.touches_store = ( | |
|
695 | self.touches_filelogs | |
|
696 | or self.touches_manifests | |
|
697 | or self.touches_changelog | |
|
698 | ) | |
|
712 | @property | |
|
713 | def upgrade_actions_names(self): | |
|
714 | return set([a.name for a in self.upgrade_actions]) | |
|
715 | ||
|
716 | @property | |
|
717 | def requirements_only(self): | |
|
699 | 718 | # does the operation only touches repository requirement |
|
700 |
|
|
|
701 |
self.touches_requirements |
|
|
719 | return ( | |
|
720 | self.touches_requirements | |
|
721 | and not self.touches_filelogs | |
|
722 | and not self.touches_manifests | |
|
723 | and not self.touches_changelog | |
|
724 | and not self.touches_dirstate | |
|
702 | 725 | ) |
|
703 | 726 | |
|
704 | def _touches_filelogs(self): | |
|
727 | @property | |
|
728 | def touches_filelogs(self): | |
|
705 | 729 | for a in self.upgrade_actions: |
|
706 | 730 | # in optimisations, we re-process the revlogs again |
|
707 | 731 | if a.type == OPTIMISATION: |
@@ -713,7 +737,8 b' class UpgradeOperation(object):' | |||
|
713 | 737 | return True |
|
714 | 738 | return False |
|
715 | 739 | |
|
716 | def _touches_manifests(self): | |
|
740 | @property | |
|
741 | def touches_manifests(self): | |
|
717 | 742 | for a in self.upgrade_actions: |
|
718 | 743 | # in optimisations, we re-process the revlogs again |
|
719 | 744 | if a.type == OPTIMISATION: |
@@ -725,7 +750,8 b' class UpgradeOperation(object):' | |||
|
725 | 750 | return True |
|
726 | 751 | return False |
|
727 | 752 | |
|
728 | def _touches_changelog(self): | |
|
753 | @property | |
|
754 | def touches_changelog(self): | |
|
729 | 755 | for a in self.upgrade_actions: |
|
730 | 756 | # in optimisations, we re-process the revlogs again |
|
731 | 757 | if a.type == OPTIMISATION: |
@@ -737,7 +763,8 b' class UpgradeOperation(object):' | |||
|
737 | 763 | return True |
|
738 | 764 | return False |
|
739 | 765 | |
|
740 | def _touches_requirements(self): | |
|
766 | @property | |
|
767 | def touches_requirements(self): | |
|
741 | 768 | for a in self.upgrade_actions: |
|
742 | 769 | # optimisations are used to re-process revlogs and does not result |
|
743 | 770 | # in a requirement being added or removed |
@@ -749,6 +776,18 b' class UpgradeOperation(object):' | |||
|
749 | 776 | if a.touches_requirements: |
|
750 | 777 | return True |
|
751 | 778 | |
|
779 | @property | |
|
780 | def touches_dirstate(self): | |
|
781 | for a in self.upgrade_actions: | |
|
782 | # revlog optimisations do not affect the dirstate | |
|
783 | if a.type == OPTIMISATION: | |
|
784 | pass | |
|
785 | elif a.touches_dirstate: | |
|
786 | return True | |
|
787 | for a in self.removed_actions: | |
|
788 | if a.touches_dirstate: | |
|
789 | return True | |
|
790 | ||
|
752 | 791 | return False |
|
753 | 792 | |
|
754 | 793 | def _write_labeled(self, l, label): |
@@ -908,6 +947,7 b' def supportremovedrequirements(repo):' | |||
|
908 | 947 | requirements.REVLOGV2_REQUIREMENT, |
|
909 | 948 | requirements.CHANGELOGV2_REQUIREMENT, |
|
910 | 949 | requirements.REVLOGV1_REQUIREMENT, |
|
950 | requirements.DIRSTATE_V2_REQUIREMENT, | |
|
911 | 951 | } |
|
912 | 952 | for name in compression.compengines: |
|
913 | 953 | engine = compression.compengines[name] |
@@ -970,6 +1010,7 b' def allowednewrequirements(repo):' | |||
|
970 | 1010 | requirements.REVLOGV1_REQUIREMENT, |
|
971 | 1011 | requirements.REVLOGV2_REQUIREMENT, |
|
972 | 1012 | requirements.CHANGELOGV2_REQUIREMENT, |
|
1013 | requirements.DIRSTATE_V2_REQUIREMENT, | |
|
973 | 1014 | } |
|
974 | 1015 | for name in compression.compengines: |
|
975 | 1016 | engine = compression.compengines[name] |
@@ -30,6 +30,7 b' from ..revlogutils import (' | |||
|
30 | 30 | nodemap, |
|
31 | 31 | sidedata as sidedatamod, |
|
32 | 32 | ) |
|
33 | from . import actions as upgrade_actions | |
|
33 | 34 | |
|
34 | 35 | |
|
35 | 36 | def get_sidedata_helpers(srcrepo, dstrepo): |
@@ -458,6 +459,19 b' def upgrade(ui, srcrepo, dstrepo, upgrad' | |||
|
458 | 459 | ) |
|
459 | 460 | ) |
|
460 | 461 | |
|
462 | if upgrade_actions.dirstatev2 in upgrade_op.upgrade_actions: | |
|
463 | ui.status(_(b'upgrading to dirstate-v2 from v1\n')) | |
|
464 | upgrade_dirstate(ui, srcrepo, upgrade_op, b'v1', b'v2') | |
|
465 | upgrade_op.upgrade_actions.remove(upgrade_actions.dirstatev2) | |
|
466 | ||
|
467 | if upgrade_actions.dirstatev2 in upgrade_op.removed_actions: | |
|
468 | ui.status(_(b'downgrading from dirstate-v2 to v1\n')) | |
|
469 | upgrade_dirstate(ui, srcrepo, upgrade_op, b'v2', b'v1') | |
|
470 | upgrade_op.removed_actions.remove(upgrade_actions.dirstatev2) | |
|
471 | ||
|
472 | if not (upgrade_op.upgrade_actions or upgrade_op.removed_actions): | |
|
473 | return | |
|
474 | ||
|
461 | 475 | if upgrade_op.requirements_only: |
|
462 | 476 | ui.status(_(b'upgrading repository requirements\n')) |
|
463 | 477 | scmutil.writereporequirements(srcrepo, upgrade_op.new_requirements) |
@@ -466,7 +480,7 b' def upgrade(ui, srcrepo, dstrepo, upgrad' | |||
|
466 | 480 | # through the whole cloning process |
|
467 | 481 | elif ( |
|
468 | 482 | len(upgrade_op.upgrade_actions) == 1 |
|
469 |
and b'persistent-nodemap' in upgrade_op. |
|
|
483 | and b'persistent-nodemap' in upgrade_op.upgrade_actions_names | |
|
470 | 484 | and not upgrade_op.removed_actions |
|
471 | 485 | ): |
|
472 | 486 | ui.status( |
@@ -591,3 +605,28 b' def upgrade(ui, srcrepo, dstrepo, upgrad' | |||
|
591 | 605 | backupvfs.unlink(b'store/lock') |
|
592 | 606 | |
|
593 | 607 | return backuppath |
|
608 | ||
|
609 | ||
|
610 | def upgrade_dirstate(ui, srcrepo, upgrade_op, old, new): | |
|
611 | if upgrade_op.backup_store: | |
|
612 | backuppath = pycompat.mkdtemp( | |
|
613 | prefix=b'upgradebackup.', dir=srcrepo.path | |
|
614 | ) | |
|
615 | ui.status(_(b'replaced files will be backed up at %s\n') % backuppath) | |
|
616 | backupvfs = vfsmod.vfs(backuppath) | |
|
617 | util.copyfile( | |
|
618 | srcrepo.vfs.join(b'requires'), backupvfs.join(b'requires') | |
|
619 | ) | |
|
620 | util.copyfile( | |
|
621 | srcrepo.vfs.join(b'dirstate'), backupvfs.join(b'dirstate') | |
|
622 | ) | |
|
623 | ||
|
624 | assert srcrepo.dirstate._use_dirstate_v2 == (old == b'v2') | |
|
625 | srcrepo.dirstate._map._use_dirstate_tree = True | |
|
626 | srcrepo.dirstate._map.preload() | |
|
627 | srcrepo.dirstate._use_dirstate_v2 = new == b'v2' | |
|
628 | srcrepo.dirstate._map._use_dirstate_v2 = srcrepo.dirstate._use_dirstate_v2 | |
|
629 | srcrepo.dirstate._dirty = True | |
|
630 | srcrepo.dirstate.write(None) | |
|
631 | ||
|
632 | scmutil.writereporequirements(srcrepo, upgrade_op.new_requirements) |
@@ -1652,6 +1652,7 b' We upgrade a repository that is not usin' | |||
|
1652 | 1652 | $ hg debugformat -v |
|
1653 | 1653 | format-variant repo config default |
|
1654 | 1654 | fncache: yes yes yes |
|
1655 | dirstate-v2: no no no | |
|
1655 | 1656 | dotencode: yes yes yes |
|
1656 | 1657 | generaldelta: yes yes yes |
|
1657 | 1658 | share-safe: no no no |
@@ -1691,6 +1692,7 b' We upgrade a repository that is not usin' | |||
|
1691 | 1692 | $ hg debugformat -v |
|
1692 | 1693 | format-variant repo config default |
|
1693 | 1694 | fncache: yes yes yes |
|
1695 | dirstate-v2: no no no | |
|
1694 | 1696 | dotencode: yes yes yes |
|
1695 | 1697 | generaldelta: yes yes yes |
|
1696 | 1698 | share-safe: no no no |
@@ -35,6 +35,7 b' Check that copies are recorded correctly' | |||
|
35 | 35 | $ hg debugformat -v |
|
36 | 36 | format-variant repo config default |
|
37 | 37 | fncache: yes yes yes |
|
38 | dirstate-v2: no no no | |
|
38 | 39 | dotencode: yes yes yes |
|
39 | 40 | generaldelta: yes yes yes |
|
40 | 41 | share-safe: no no no |
@@ -52,6 +53,7 b' Check that copies are recorded correctly' | |||
|
52 | 53 | $ hg debugformat -v |
|
53 | 54 | format-variant repo config default |
|
54 | 55 | fncache: yes yes yes |
|
56 | dirstate-v2: no no no | |
|
55 | 57 | dotencode: yes yes yes |
|
56 | 58 | generaldelta: yes yes yes |
|
57 | 59 | share-safe: no no no |
@@ -426,6 +428,7 b' downgrading' | |||
|
426 | 428 | $ hg debugformat -v |
|
427 | 429 | format-variant repo config default |
|
428 | 430 | fncache: yes yes yes |
|
431 | dirstate-v2: no no no | |
|
429 | 432 | dotencode: yes yes yes |
|
430 | 433 | generaldelta: yes yes yes |
|
431 | 434 | share-safe: no no no |
@@ -456,6 +459,7 b' downgrading' | |||
|
456 | 459 | $ hg debugformat -v |
|
457 | 460 | format-variant repo config default |
|
458 | 461 | fncache: yes yes yes |
|
462 | dirstate-v2: no no no | |
|
459 | 463 | dotencode: yes yes yes |
|
460 | 464 | generaldelta: yes yes yes |
|
461 | 465 | share-safe: no no no |
@@ -483,6 +487,7 b' upgrading' | |||
|
483 | 487 | $ hg debugformat -v |
|
484 | 488 | format-variant repo config default |
|
485 | 489 | fncache: yes yes yes |
|
490 | dirstate-v2: no no no | |
|
486 | 491 | dotencode: yes yes yes |
|
487 | 492 | generaldelta: yes yes yes |
|
488 | 493 | share-safe: no no no |
@@ -57,6 +57,7 b' As a result, -1 passed from Rust for the' | |||
|
57 | 57 | $ hg debugformat |
|
58 | 58 | format-variant repo |
|
59 | 59 | fncache: yes |
|
60 | dirstate-v2: no | |
|
60 | 61 | dotencode: yes |
|
61 | 62 | generaldelta: yes |
|
62 | 63 | share-safe: no |
@@ -577,6 +578,7 b' downgrading' | |||
|
577 | 578 | $ hg debugformat -v |
|
578 | 579 | format-variant repo config default |
|
579 | 580 | fncache: yes yes yes |
|
581 | dirstate-v2: no no no | |
|
580 | 582 | dotencode: yes yes yes |
|
581 | 583 | generaldelta: yes yes yes |
|
582 | 584 | share-safe: no no no |
@@ -626,6 +628,7 b' upgrading' | |||
|
626 | 628 | $ hg debugformat -v |
|
627 | 629 | format-variant repo config default |
|
628 | 630 | fncache: yes yes yes |
|
631 | dirstate-v2: no no no | |
|
629 | 632 | dotencode: yes yes yes |
|
630 | 633 | generaldelta: yes yes yes |
|
631 | 634 | share-safe: no no no |
@@ -52,6 +52,7 b' Check that we can upgrade to sidedata' | |||
|
52 | 52 | $ hg debugformat -v -R up-no-side-data |
|
53 | 53 | format-variant repo config default |
|
54 | 54 | fncache: yes yes yes |
|
55 | dirstate-v2: no no no | |
|
55 | 56 | dotencode: yes yes yes |
|
56 | 57 | generaldelta: yes yes yes |
|
57 | 58 | share-safe: no no no |
@@ -68,6 +69,7 b' Check that we can upgrade to sidedata' | |||
|
68 | 69 | $ hg debugformat -v -R up-no-side-data --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data |
|
69 | 70 | format-variant repo config default |
|
70 | 71 | fncache: yes yes yes |
|
72 | dirstate-v2: no no no | |
|
71 | 73 | dotencode: yes yes yes |
|
72 | 74 | generaldelta: yes yes yes |
|
73 | 75 | share-safe: no no no |
@@ -90,6 +92,7 b' Check that we can downgrade from sidedat' | |||
|
90 | 92 | $ hg debugformat -v -R up-side-data |
|
91 | 93 | format-variant repo config default |
|
92 | 94 | fncache: yes yes yes |
|
95 | dirstate-v2: no no no | |
|
93 | 96 | dotencode: yes yes yes |
|
94 | 97 | generaldelta: yes yes yes |
|
95 | 98 | share-safe: no no no |
@@ -106,6 +109,7 b' Check that we can downgrade from sidedat' | |||
|
106 | 109 | $ hg debugformat -v -R up-side-data --config experimental.revlogv2=no |
|
107 | 110 | format-variant repo config default |
|
108 | 111 | fncache: yes yes yes |
|
112 | dirstate-v2: no no no | |
|
109 | 113 | dotencode: yes yes yes |
|
110 | 114 | generaldelta: yes yes yes |
|
111 | 115 | share-safe: no no no |
@@ -57,6 +57,7 b' An upgrade of a repository created with ' | |||
|
57 | 57 | $ hg debugformat |
|
58 | 58 | format-variant repo |
|
59 | 59 | fncache: yes |
|
60 | dirstate-v2: no | |
|
60 | 61 | dotencode: yes |
|
61 | 62 | generaldelta: yes |
|
62 | 63 | share-safe: no |
@@ -72,6 +73,7 b' An upgrade of a repository created with ' | |||
|
72 | 73 | $ hg debugformat --verbose |
|
73 | 74 | format-variant repo config default |
|
74 | 75 | fncache: yes yes yes |
|
76 | dirstate-v2: no no no | |
|
75 | 77 | dotencode: yes yes yes |
|
76 | 78 | generaldelta: yes yes yes |
|
77 | 79 | share-safe: no no no |
@@ -88,6 +90,7 b' An upgrade of a repository created with ' | |||
|
88 | 90 | $ hg debugformat --verbose --config format.usefncache=no |
|
89 | 91 | format-variant repo config default |
|
90 | 92 | fncache: yes no yes |
|
93 | dirstate-v2: no no no | |
|
91 | 94 | dotencode: yes no yes |
|
92 | 95 | generaldelta: yes yes yes |
|
93 | 96 | share-safe: no no no |
@@ -104,6 +107,7 b' An upgrade of a repository created with ' | |||
|
104 | 107 | $ hg debugformat --verbose --config format.usefncache=no --color=debug |
|
105 | 108 | format-variant repo config default |
|
106 | 109 | [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes] |
|
110 | [formatvariant.name.uptodate|dirstate-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] | |
|
107 | 111 | [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes] |
|
108 | 112 | [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes] |
|
109 | 113 | [formatvariant.name.uptodate|share-safe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] |
@@ -126,6 +130,12 b' An upgrade of a repository created with ' | |||
|
126 | 130 | "repo": true |
|
127 | 131 | }, |
|
128 | 132 | { |
|
133 | "config": false, | |
|
134 | "default": false, | |
|
135 | "name": "dirstate-v2", | |
|
136 | "repo": false | |
|
137 | }, | |
|
138 | { | |
|
129 | 139 | "config": true, |
|
130 | 140 | "default": true, |
|
131 | 141 | "name": "dotencode", |
@@ -327,6 +337,7 b' Various sub-optimal detections work' | |||
|
327 | 337 | $ hg debugformat |
|
328 | 338 | format-variant repo |
|
329 | 339 | fncache: no |
|
340 | dirstate-v2: no | |
|
330 | 341 | dotencode: no |
|
331 | 342 | generaldelta: no |
|
332 | 343 | share-safe: no |
@@ -341,6 +352,7 b' Various sub-optimal detections work' | |||
|
341 | 352 | $ hg debugformat --verbose |
|
342 | 353 | format-variant repo config default |
|
343 | 354 | fncache: no yes yes |
|
355 | dirstate-v2: no no no | |
|
344 | 356 | dotencode: no yes yes |
|
345 | 357 | generaldelta: no yes yes |
|
346 | 358 | share-safe: no no no |
@@ -357,6 +369,7 b' Various sub-optimal detections work' | |||
|
357 | 369 | $ hg debugformat --verbose --config format.usegeneraldelta=no |
|
358 | 370 | format-variant repo config default |
|
359 | 371 | fncache: no yes yes |
|
372 | dirstate-v2: no no no | |
|
360 | 373 | dotencode: no yes yes |
|
361 | 374 | generaldelta: no no yes |
|
362 | 375 | share-safe: no no no |
@@ -373,6 +386,7 b' Various sub-optimal detections work' | |||
|
373 | 386 | $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug |
|
374 | 387 | format-variant repo config default |
|
375 | 388 | [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes] |
|
389 | [formatvariant.name.uptodate|dirstate-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] | |
|
376 | 390 | [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes] |
|
377 | 391 | [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes] |
|
378 | 392 | [formatvariant.name.uptodate|share-safe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] |
@@ -1355,6 +1369,7 b' upgrade' | |||
|
1355 | 1369 | $ hg debugformat -v |
|
1356 | 1370 | format-variant repo config default |
|
1357 | 1371 | fncache: yes yes yes |
|
1372 | dirstate-v2: no no no | |
|
1358 | 1373 | dotencode: yes yes yes |
|
1359 | 1374 | generaldelta: yes yes yes |
|
1360 | 1375 | share-safe: no no no |
@@ -1396,6 +1411,7 b' downgrade' | |||
|
1396 | 1411 | $ hg debugformat -v |
|
1397 | 1412 | format-variant repo config default |
|
1398 | 1413 | fncache: yes yes yes |
|
1414 | dirstate-v2: no no no | |
|
1399 | 1415 | dotencode: yes yes yes |
|
1400 | 1416 | generaldelta: yes yes yes |
|
1401 | 1417 | share-safe: no no no |
@@ -1440,6 +1456,7 b' upgrade from hgrc' | |||
|
1440 | 1456 | $ hg debugformat -v |
|
1441 | 1457 | format-variant repo config default |
|
1442 | 1458 | fncache: yes yes yes |
|
1459 | dirstate-v2: no no no | |
|
1443 | 1460 | dotencode: yes yes yes |
|
1444 | 1461 | generaldelta: yes yes yes |
|
1445 | 1462 | share-safe: no no no |
@@ -1490,6 +1507,7 b' upgrade' | |||
|
1490 | 1507 | $ hg debugformat -v |
|
1491 | 1508 | format-variant repo config default |
|
1492 | 1509 | fncache: yes yes yes |
|
1510 | dirstate-v2: no no no | |
|
1493 | 1511 | dotencode: yes yes yes |
|
1494 | 1512 | generaldelta: yes yes yes |
|
1495 | 1513 | share-safe: no no no |
@@ -1537,6 +1555,7 b' downgrade' | |||
|
1537 | 1555 | $ hg debugformat -v |
|
1538 | 1556 | format-variant repo config default |
|
1539 | 1557 | fncache: yes yes yes |
|
1558 | dirstate-v2: no no no | |
|
1540 | 1559 | dotencode: yes yes yes |
|
1541 | 1560 | generaldelta: yes yes yes |
|
1542 | 1561 | share-safe: no no no |
@@ -1585,6 +1604,7 b' upgrade from hgrc' | |||
|
1585 | 1604 | $ hg debugformat -v |
|
1586 | 1605 | format-variant repo config default |
|
1587 | 1606 | fncache: yes yes yes |
|
1607 | dirstate-v2: no no no | |
|
1588 | 1608 | dotencode: yes yes yes |
|
1589 | 1609 | generaldelta: yes yes yes |
|
1590 | 1610 | share-safe: no no no |
@@ -1613,3 +1633,105 b' Demonstrate that nothing to perform upgr' | |||
|
1613 | 1633 | |
|
1614 | 1634 | $ hg debugupgraderepo --run |
|
1615 | 1635 | nothing to do |
|
1636 | ||
|
1637 | #if rust | |
|
1638 | ||
|
1639 | Upgrade to dirstate-v2 | |
|
1640 | ||
|
1641 | $ hg debugformat -v --config format.exp-dirstate-v2=1 | |
|
1642 | format-variant repo config default | |
|
1643 | fncache: yes yes yes | |
|
1644 | dirstate-v2: no yes no | |
|
1645 | dotencode: yes yes yes | |
|
1646 | generaldelta: yes yes yes | |
|
1647 | share-safe: no no no | |
|
1648 | sparserevlog: yes yes yes | |
|
1649 | persistent-nodemap: yes yes no | |
|
1650 | copies-sdc: no no no | |
|
1651 | revlog-v2: yes yes no | |
|
1652 | changelog-v2: no no no | |
|
1653 | plain-cl-delta: yes yes yes | |
|
1654 | compression: zstd zstd zstd | |
|
1655 | compression-level: default default default | |
|
1656 | $ hg debugupgraderepo --config format.exp-dirstate-v2=1 --run | |
|
1657 | upgrade will perform the following actions: | |
|
1658 | ||
|
1659 | requirements | |
|
1660 | preserved: dotencode, exp-revlogv2.2, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, sparserevlog, store | |
|
1661 | added: exp-dirstate-v2 | |
|
1662 | ||
|
1663 | dirstate-v2 | |
|
1664 | "hg status" will be faster | |
|
1665 | ||
|
1666 | processed revlogs: | |
|
1667 | - all-filelogs | |
|
1668 | - changelog | |
|
1669 | - manifest | |
|
1670 | ||
|
1671 | beginning upgrade... | |
|
1672 | repository locked and read-only | |
|
1673 | creating temporary repository to stage upgraded data: $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob) | |
|
1674 | (it is safe to interrupt this process any time before data migration completes) | |
|
1675 | upgrading to dirstate-v2 from v1 | |
|
1676 | replaced files will be backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob) | |
|
1677 | removing temporary repository $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob) | |
|
1678 | $ ls .hg/upgradebackup.*/dirstate | |
|
1679 | .hg/upgradebackup.*/dirstate (glob) | |
|
1680 | $ hg debugformat -v | |
|
1681 | format-variant repo config default | |
|
1682 | fncache: yes yes yes | |
|
1683 | dirstate-v2: yes no no | |
|
1684 | dotencode: yes yes yes | |
|
1685 | generaldelta: yes yes yes | |
|
1686 | share-safe: no no no | |
|
1687 | sparserevlog: yes yes yes | |
|
1688 | persistent-nodemap: yes yes no | |
|
1689 | copies-sdc: no no no | |
|
1690 | revlog-v2: yes yes no | |
|
1691 | changelog-v2: no no no | |
|
1692 | plain-cl-delta: yes yes yes | |
|
1693 | compression: zstd zstd zstd | |
|
1694 | compression-level: default default default | |
|
1695 | $ hg status | |
|
1696 | $ dd status=none bs=12 count=1 if=.hg/dirstate | |
|
1697 | dirstate-v2 | |
|
1698 | ||
|
1699 | Downgrade from dirstate-v2 | |
|
1700 | ||
|
1701 | $ hg debugupgraderepo --run | |
|
1702 | upgrade will perform the following actions: | |
|
1703 | ||
|
1704 | requirements | |
|
1705 | preserved: dotencode, exp-revlogv2.2, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, sparserevlog, store | |
|
1706 | removed: exp-dirstate-v2 | |
|
1707 | ||
|
1708 | processed revlogs: | |
|
1709 | - all-filelogs | |
|
1710 | - changelog | |
|
1711 | - manifest | |
|
1712 | ||
|
1713 | beginning upgrade... | |
|
1714 | repository locked and read-only | |
|
1715 | creating temporary repository to stage upgraded data: $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob) | |
|
1716 | (it is safe to interrupt this process any time before data migration completes) | |
|
1717 | downgrading from dirstate-v2 to v1 | |
|
1718 | replaced files will be backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob) | |
|
1719 | removing temporary repository $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob) | |
|
1720 | $ hg debugformat -v | |
|
1721 | format-variant repo config default | |
|
1722 | fncache: yes yes yes | |
|
1723 | dirstate-v2: no no no | |
|
1724 | dotencode: yes yes yes | |
|
1725 | generaldelta: yes yes yes | |
|
1726 | share-safe: no no no | |
|
1727 | sparserevlog: yes yes yes | |
|
1728 | persistent-nodemap: yes yes no | |
|
1729 | copies-sdc: no no no | |
|
1730 | revlog-v2: yes yes no | |
|
1731 | changelog-v2: no no no | |
|
1732 | plain-cl-delta: yes yes yes | |
|
1733 | compression: zstd zstd zstd | |
|
1734 | compression-level: default default default | |
|
1735 | $ hg status | |
|
1736 | ||
|
1737 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now