Mercurial > hg-stable
comparison tests/test-clone-stream-format.t @ 48620:a6f16ec07ed7
stream-clone: add a explicit test for format change during stream clone
They are different kind of requirements, the one which impact the data storage
and are relevant to the files being streamed and the one which does not. For
example some requirements are only relevant to the working copy, like sparse, or
dirstate-v2.
Since they are irrelevant to the content being streamed, they do not prevent the
receiving side to use streaming clone and mercurial skip adverting them over
the wire and, ideally, within the bundle.
In addition, this let the client decide to use whichever format it desire for
the part that does not affect the store itself. So the configuration related to
these format are used as normal when doing a streaming clone.
In practice, the feature was not really tested and is badly broken with bundle-2,
since the requirements are not filtered out from the stream bundle.
So we start with adding simple tests as a good base before the fix and adjust
the feature.
Differential Revision: https://phab.mercurial-scm.org/D12029
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 17 Jan 2022 18:51:47 +0100 |
parents | |
children | a3cf460a6b1b |
comparison
equal
deleted
inserted
replaced
48619:8475a1364909 | 48620:a6f16ec07ed7 |
---|---|
1 This file contains tests case that deal with format change accross stream clone | |
2 | |
3 #require serve no-reposimplestore no-chg | |
4 | |
5 #testcases stream-legacy | |
6 | |
7 (the #stream-bundle2 variant is actually buggy for the moment) | |
8 | |
9 #if stream-legacy | |
10 $ cat << EOF >> $HGRCPATH | |
11 > [server] | |
12 > bundle2.stream = no | |
13 > EOF | |
14 #endif | |
15 | |
16 Initialize repository | |
17 | |
18 $ hg init server | |
19 $ cd server | |
20 $ sh $TESTDIR/testlib/stream_clone_setup.sh | |
21 adding 00changelog-ab349180a0405010.nd | |
22 adding 00changelog.d | |
23 adding 00changelog.i | |
24 adding 00changelog.n | |
25 adding 00manifest.d | |
26 adding 00manifest.i | |
27 adding container/isam-build-centos7/bazel-coverage-generator-sandboxfs-compatibility-0758e3e4f6057904d44399bd666faba9e7f40686.patch | |
28 adding data/foo.d | |
29 adding data/foo.i | |
30 adding data/foo.n | |
31 adding data/undo.babar | |
32 adding data/undo.d | |
33 adding data/undo.foo.d | |
34 adding data/undo.foo.i | |
35 adding data/undo.foo.n | |
36 adding data/undo.i | |
37 adding data/undo.n | |
38 adding data/undo.py | |
39 adding foo.d | |
40 adding foo.i | |
41 adding foo.n | |
42 adding meta/foo.d | |
43 adding meta/foo.i | |
44 adding meta/foo.n | |
45 adding meta/undo.babar | |
46 adding meta/undo.d | |
47 adding meta/undo.foo.d | |
48 adding meta/undo.foo.i | |
49 adding meta/undo.foo.n | |
50 adding meta/undo.i | |
51 adding meta/undo.n | |
52 adding meta/undo.py | |
53 adding savanah/foo.d | |
54 adding savanah/foo.i | |
55 adding savanah/foo.n | |
56 adding savanah/undo.babar | |
57 adding savanah/undo.d | |
58 adding savanah/undo.foo.d | |
59 adding savanah/undo.foo.i | |
60 adding savanah/undo.foo.n | |
61 adding savanah/undo.i | |
62 adding savanah/undo.n | |
63 adding savanah/undo.py | |
64 adding store/C\xc3\xa9lesteVille_is_a_Capital_City (esc) | |
65 adding store/foo.d | |
66 adding store/foo.i | |
67 adding store/foo.n | |
68 adding store/undo.babar | |
69 adding store/undo.d | |
70 adding store/undo.foo.d | |
71 adding store/undo.foo.i | |
72 adding store/undo.foo.n | |
73 adding store/undo.i | |
74 adding store/undo.n | |
75 adding store/undo.py | |
76 adding undo.babar | |
77 adding undo.d | |
78 adding undo.foo.d | |
79 adding undo.foo.i | |
80 adding undo.foo.n | |
81 adding undo.i | |
82 adding undo.n | |
83 adding undo.py | |
84 $ cd .. | |
85 | |
86 | |
87 Test streaming from/to repository without a store: | |
88 ================================================== | |
89 | |
90 $ hg clone --pull --config format.usestore=no server server-no-store | |
91 requesting all changes | |
92 adding changesets | |
93 adding manifests | |
94 adding file changes | |
95 added 3 changesets with 1088 changes to 1088 files | |
96 new changesets 96ee1d7354c4:5223b5e3265f | |
97 updating to branch default | |
98 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
99 $ hg verify -R server-no-store | |
100 checking changesets | |
101 checking manifests | |
102 crosschecking files in changesets and manifests | |
103 checking files | |
104 checked 3 changesets with 1088 changes to 1088 files | |
105 $ hg -R server serve -p $HGPORT -d --pid-file=hg-1.pid --error errors-1.txt | |
106 $ cat hg-1.pid > $DAEMON_PIDS | |
107 $ hg -R server-no-store serve -p $HGPORT2 -d --pid-file=hg-2.pid --error errors-2.txt | |
108 $ cat hg-2.pid >> $DAEMON_PIDS | |
109 $ hg debugrequires -R server | grep store | |
110 store | |
111 $ hg debugrequires -R server-no-store | grep store | |
112 [1] | |
113 | |
114 store → no-store cloning | |
115 | |
116 $ hg clone --quiet --stream -U http://localhost:$HGPORT clone-remove-store --config format.usestore=no | |
117 $ cat errors-1.txt | |
118 $ hg -R clone-remove-store verify | |
119 checking changesets | |
120 checking manifests | |
121 crosschecking files in changesets and manifests | |
122 checking files | |
123 checked 3 changesets with 1088 changes to 1088 files | |
124 $ hg debugrequires -R clone-remove-store | grep store | |
125 [1] | |
126 | |
127 | |
128 no-store → store cloning | |
129 | |
130 $ hg clone --quiet --stream -U http://localhost:$HGPORT2 clone-add-store --config format.usestore=yes | |
131 $ cat errors-2.txt | |
132 $ hg -R clone-add-store verify | |
133 checking changesets | |
134 checking manifests | |
135 crosschecking files in changesets and manifests | |
136 checking files | |
137 checked 3 changesets with 1088 changes to 1088 files | |
138 $ hg debugrequires -R clone-add-store | grep store | |
139 store | |
140 | |
141 | |
142 $ killdaemons.py | |
143 | |
144 | |
145 Test streaming from/to repository without a fncache | |
146 =================================================== | |
147 | |
148 $ rm hg-*.pid errors-*.txt | |
149 $ hg clone --pull --config format.usefncache=no server server-no-fncache | |
150 requesting all changes | |
151 adding changesets | |
152 adding manifests | |
153 adding file changes | |
154 added 3 changesets with 1088 changes to 1088 files | |
155 new changesets 96ee1d7354c4:5223b5e3265f | |
156 updating to branch default | |
157 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
158 $ hg verify -R server-no-fncache | |
159 checking changesets | |
160 checking manifests | |
161 crosschecking files in changesets and manifests | |
162 checking files | |
163 checked 3 changesets with 1088 changes to 1088 files | |
164 $ hg -R server serve -p $HGPORT -d --pid-file=hg-1.pid --error errors-1.txt | |
165 $ cat hg-1.pid > $DAEMON_PIDS | |
166 $ hg -R server-no-fncache serve -p $HGPORT2 -d --pid-file=hg-2.pid --error errors-2.txt | |
167 $ cat hg-2.pid >> $DAEMON_PIDS | |
168 $ hg debugrequires -R server | grep fncache | |
169 fncache | |
170 $ hg debugrequires -R server-no-fncache | grep fncache | |
171 [1] | |
172 | |
173 fncache → no-fncache cloning | |
174 | |
175 $ hg clone --quiet --stream -U http://localhost:$HGPORT clone-remove-fncache --config format.usefncache=no | |
176 $ cat errors-1.txt | |
177 $ hg -R clone-remove-fncache verify | |
178 checking changesets | |
179 checking manifests | |
180 crosschecking files in changesets and manifests | |
181 checking files | |
182 checked 3 changesets with 1088 changes to 1088 files | |
183 $ hg debugrequires -R clone-remove-fncache | grep fncache | |
184 [1] | |
185 | |
186 | |
187 no-fncache → fncache cloning | |
188 | |
189 $ hg clone --quiet --stream -U http://localhost:$HGPORT2 clone-add-fncache --config format.usefncache=yes | |
190 $ cat errors-2.txt | |
191 $ hg -R clone-add-fncache verify | |
192 checking changesets | |
193 checking manifests | |
194 crosschecking files in changesets and manifests | |
195 checking files | |
196 checked 3 changesets with 1088 changes to 1088 files | |
197 $ hg debugrequires -R clone-add-fncache | grep fncache | |
198 fncache | |
199 | |
200 | |
201 $ killdaemons.py | |
202 | |
203 | |
204 | |
205 Test streaming from/to repository without a dotencode | |
206 =================================================== | |
207 | |
208 $ rm hg-*.pid errors-*.txt | |
209 $ hg clone --pull --config format.dotencode=no server server-no-dotencode | |
210 requesting all changes | |
211 adding changesets | |
212 adding manifests | |
213 adding file changes | |
214 added 3 changesets with 1088 changes to 1088 files | |
215 new changesets 96ee1d7354c4:5223b5e3265f | |
216 updating to branch default | |
217 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
218 $ hg verify -R server-no-dotencode | |
219 checking changesets | |
220 checking manifests | |
221 crosschecking files in changesets and manifests | |
222 checking files | |
223 checked 3 changesets with 1088 changes to 1088 files | |
224 $ hg -R server serve -p $HGPORT -d --pid-file=hg-1.pid --error errors-1.txt | |
225 $ cat hg-1.pid > $DAEMON_PIDS | |
226 $ hg -R server-no-dotencode serve -p $HGPORT2 -d --pid-file=hg-2.pid --error errors-2.txt | |
227 $ cat hg-2.pid >> $DAEMON_PIDS | |
228 $ hg debugrequires -R server | grep dotencode | |
229 dotencode | |
230 $ hg debugrequires -R server-no-dotencode | grep dotencode | |
231 [1] | |
232 | |
233 dotencode → no-dotencode cloning | |
234 | |
235 $ hg clone --quiet --stream -U http://localhost:$HGPORT clone-remove-dotencode --config format.dotencode=no | |
236 $ cat errors-1.txt | |
237 $ hg -R clone-remove-dotencode verify | |
238 checking changesets | |
239 checking manifests | |
240 crosschecking files in changesets and manifests | |
241 checking files | |
242 checked 3 changesets with 1088 changes to 1088 files | |
243 $ hg debugrequires -R clone-remove-dotencode | grep dotencode | |
244 [1] | |
245 | |
246 | |
247 no-dotencode → dotencode cloning | |
248 | |
249 $ hg clone --quiet --stream -U http://localhost:$HGPORT2 clone-add-dotencode --config format.dotencode=yes | |
250 $ cat errors-2.txt | |
251 $ hg -R clone-add-dotencode verify | |
252 checking changesets | |
253 checking manifests | |
254 crosschecking files in changesets and manifests | |
255 checking files | |
256 checked 3 changesets with 1088 changes to 1088 files | |
257 $ hg debugrequires -R clone-add-dotencode | grep dotencode | |
258 dotencode | |
259 | |
260 | |
261 $ killdaemons.py | |
262 | |
263 Cloning from a share | |
264 -------------------- | |
265 | |
266 We should be able to clone from a "share" repository, it will use the source store for streaming. | |
267 | |
268 The resulting clone should not use share. | |
269 | |
270 $ rm hg-*.pid errors-*.txt | |
271 $ hg share --config extensions.share= server server-share -U | |
272 $ hg -R server-share serve -p $HGPORT -d --pid-file=hg-1.pid --error errors-1.txt | |
273 $ cat hg-1.pid > $DAEMON_PIDS | |
274 | |
275 $ hg clone --quiet --stream -U http://localhost:$HGPORT clone-from-share | |
276 $ hg -R clone-from-share verify | |
277 checking changesets | |
278 checking manifests | |
279 crosschecking files in changesets and manifests | |
280 checking files | |
281 checked 3 changesets with 1088 changes to 1088 files | |
282 $ hg debugrequires -R clone-from-share | grep share | |
283 [1] | |
284 | |
285 $ killdaemons.py |