comparison tests/test-upgrade-repo.t @ 48780:6e77083683a7

upgrade: make dirstate-v2 format variant compatible with share This only affects the dirstate and is safe to upgrade in the share. Differential Revision: https://phab.mercurial-scm.org/D12197
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 15 Feb 2022 23:45:30 +0100
parents 17eaeb06562c
children 5ba24e886cec
comparison
equal deleted inserted replaced
48779:17eaeb06562c 48780:6e77083683a7
4 > [extensions] 4 > [extensions]
5 > share = 5 > share =
6 > [format] 6 > [format]
7 > # stabilize test accross variant 7 > # stabilize test accross variant
8 > revlog-compression=zlib 8 > revlog-compression=zlib
9 > [storage]
10 > dirstate-v2.slow-path=allow
9 > EOF 11 > EOF
10 12
11 store and revlogv1 are required in source 13 store and revlogv1 are required in source
12 14
13 $ hg --config format.usestore=false init no-store 15 $ hg --config format.usestore=false init no-store
28 [255] 30 [255]
29 31
30 Cannot upgrade shared repositories 32 Cannot upgrade shared repositories
31 33
32 $ hg init share-parent 34 $ hg init share-parent
35 $ hg -R share-parent debugbuilddag -n .+9
36 $ hg -R share-parent up tip
37 10 files updated, 0 files merged, 0 files removed, 0 files unresolved
33 $ hg -q share share-parent share-child 38 $ hg -q share share-parent share-child
34 39
35 $ hg -R share-child debugupgraderepo --config format.sparse-revlog=no 40 $ hg -R share-child debugupgraderepo --config format.sparse-revlog=no
36 abort: cannot use these actions on a share repository: sparserevlog 41 abort: cannot use these actions on a share repository: sparserevlog
37 (upgrade the main repository directly) 42 (upgrade the main repository directly)
38 [255] 43 [255]
39 44
45 Unless the action is compatible with share
46
47 $ hg -R share-child debugupgraderepo --config format.use-dirstate-v2=yes --quiet
48 requirements
49 preserved: * (glob)
50 added: dirstate-v2
51
52 no revlogs to process
53
54
55 $ hg -R share-child debugupgraderepo --config format.use-dirstate-v2=yes --quiet --run
56 upgrade will perform the following actions:
57
58 requirements
59 preserved: * (glob)
60 added: dirstate-v2
61
62 no revlogs to process
63
64 $ hg debugformat -R share-child | grep dirstate-v2
65 dirstate-v2: yes
66 $ hg debugformat -R share-parent | grep dirstate-v2
67 dirstate-v2: no
68 $ hg status --all -R share-child
69 C nf0
70 C nf1
71 C nf2
72 C nf3
73 C nf4
74 C nf5
75 C nf6
76 C nf7
77 C nf8
78 C nf9
79 $ hg log -l 3 -R share-child
80 changeset: 9:0059eb38e4a4
81 tag: tip
82 user: debugbuilddag
83 date: Thu Jan 01 00:00:09 1970 +0000
84 summary: r9
85
86 changeset: 8:4d5be70c8130
87 user: debugbuilddag
88 date: Thu Jan 01 00:00:08 1970 +0000
89 summary: r8
90
91 changeset: 7:e60bfe72517e
92 user: debugbuilddag
93 date: Thu Jan 01 00:00:07 1970 +0000
94 summary: r7
95
96 $ hg status --all -R share-parent
97 C nf0
98 C nf1
99 C nf2
100 C nf3
101 C nf4
102 C nf5
103 C nf6
104 C nf7
105 C nf8
106 C nf9
107 $ hg log -l 3 -R share-parent
108 changeset: 9:0059eb38e4a4
109 tag: tip
110 user: debugbuilddag
111 date: Thu Jan 01 00:00:09 1970 +0000
112 summary: r9
113
114 changeset: 8:4d5be70c8130
115 user: debugbuilddag
116 date: Thu Jan 01 00:00:08 1970 +0000
117 summary: r8
118
119 changeset: 7:e60bfe72517e
120 user: debugbuilddag
121 date: Thu Jan 01 00:00:07 1970 +0000
122 summary: r7
123
124
125 $ hg -R share-child debugupgraderepo --config format.use-dirstate-v2=no --quiet --run
126 upgrade will perform the following actions:
127
128 requirements
129 preserved: * (glob)
130 removed: dirstate-v2
131
132 no revlogs to process
133
134 $ hg debugformat -R share-child | grep dirstate-v2
135 dirstate-v2: no
136 $ hg debugformat -R share-parent | grep dirstate-v2
137 dirstate-v2: no
138 $ hg status --all -R share-child
139 C nf0
140 C nf1
141 C nf2
142 C nf3
143 C nf4
144 C nf5
145 C nf6
146 C nf7
147 C nf8
148 C nf9
149 $ hg log -l 3 -R share-child
150 changeset: 9:0059eb38e4a4
151 tag: tip
152 user: debugbuilddag
153 date: Thu Jan 01 00:00:09 1970 +0000
154 summary: r9
155
156 changeset: 8:4d5be70c8130
157 user: debugbuilddag
158 date: Thu Jan 01 00:00:08 1970 +0000
159 summary: r8
160
161 changeset: 7:e60bfe72517e
162 user: debugbuilddag
163 date: Thu Jan 01 00:00:07 1970 +0000
164 summary: r7
165
166 $ hg status --all -R share-parent
167 C nf0
168 C nf1
169 C nf2
170 C nf3
171 C nf4
172 C nf5
173 C nf6
174 C nf7
175 C nf8
176 C nf9
177 $ hg log -l 3 -R share-parent
178 changeset: 9:0059eb38e4a4
179 tag: tip
180 user: debugbuilddag
181 date: Thu Jan 01 00:00:09 1970 +0000
182 summary: r9
183
184 changeset: 8:4d5be70c8130
185 user: debugbuilddag
186 date: Thu Jan 01 00:00:08 1970 +0000
187 summary: r8
188
189 changeset: 7:e60bfe72517e
190 user: debugbuilddag
191 date: Thu Jan 01 00:00:07 1970 +0000
192 summary: r7
193
40 194
41 Do not yet support upgrading treemanifest repos 195 Do not yet support upgrading treemanifest repos
42 196
43 $ hg --config experimental.treemanifest=true init treemanifest 197 $ hg --config experimental.treemanifest=true init treemanifest
44 $ hg -R treemanifest debugupgraderepo 198 $ hg -R treemanifest debugupgraderepo