Show More
@@ -1,785 +1,705 | |||
|
1 | 1 | #require serve no-reposimplestore no-chg |
|
2 | 2 | |
|
3 | 3 | #testcases stream-legacy stream-bundle2-v2 stream-bundle2-v3 |
|
4 | 4 | |
|
5 | 5 | #if stream-legacy |
|
6 | 6 | $ cat << EOF >> $HGRCPATH |
|
7 | 7 | > [server] |
|
8 | 8 | > bundle2.stream = no |
|
9 | 9 | > [format] |
|
10 | 10 | > # persistent nodemap is too broken with legacy format, |
|
11 | 11 | > # however client with nodemap support will have better stream support. |
|
12 | 12 | > use-persistent-nodemap=no |
|
13 | 13 | > EOF |
|
14 | 14 | #endif |
|
15 | 15 | #if stream-bundle2-v3 |
|
16 | 16 | $ cat << EOF >> $HGRCPATH |
|
17 | 17 | > [experimental] |
|
18 | 18 | > stream-v3 = yes |
|
19 | 19 | > EOF |
|
20 | 20 | #endif |
|
21 | 21 | |
|
22 | 22 | Initialize repository |
|
23 | 23 | |
|
24 | 24 | $ hg init server |
|
25 | 25 | $ cd server |
|
26 | 26 | $ sh $TESTDIR/testlib/stream_clone_setup.sh |
|
27 | 27 | adding 00changelog-ab349180a0405010.nd |
|
28 | 28 | adding 00changelog.d |
|
29 | 29 | adding 00changelog.i |
|
30 | 30 | adding 00changelog.n |
|
31 | 31 | adding 00manifest.d |
|
32 | 32 | adding 00manifest.i |
|
33 | 33 | adding container/isam-build-centos7/bazel-coverage-generator-sandboxfs-compatibility-0758e3e4f6057904d44399bd666faba9e7f40686.patch |
|
34 | 34 | adding data/foo.d |
|
35 | 35 | adding data/foo.i |
|
36 | 36 | adding data/foo.n |
|
37 | 37 | adding data/undo.babar |
|
38 | 38 | adding data/undo.d |
|
39 | 39 | adding data/undo.foo.d |
|
40 | 40 | adding data/undo.foo.i |
|
41 | 41 | adding data/undo.foo.n |
|
42 | 42 | adding data/undo.i |
|
43 | 43 | adding data/undo.n |
|
44 | 44 | adding data/undo.py |
|
45 | 45 | adding foo.d |
|
46 | 46 | adding foo.i |
|
47 | 47 | adding foo.n |
|
48 | 48 | adding meta/foo.d |
|
49 | 49 | adding meta/foo.i |
|
50 | 50 | adding meta/foo.n |
|
51 | 51 | adding meta/undo.babar |
|
52 | 52 | adding meta/undo.d |
|
53 | 53 | adding meta/undo.foo.d |
|
54 | 54 | adding meta/undo.foo.i |
|
55 | 55 | adding meta/undo.foo.n |
|
56 | 56 | adding meta/undo.i |
|
57 | 57 | adding meta/undo.n |
|
58 | 58 | adding meta/undo.py |
|
59 | 59 | adding savanah/foo.d |
|
60 | 60 | adding savanah/foo.i |
|
61 | 61 | adding savanah/foo.n |
|
62 | 62 | adding savanah/undo.babar |
|
63 | 63 | adding savanah/undo.d |
|
64 | 64 | adding savanah/undo.foo.d |
|
65 | 65 | adding savanah/undo.foo.i |
|
66 | 66 | adding savanah/undo.foo.n |
|
67 | 67 | adding savanah/undo.i |
|
68 | 68 | adding savanah/undo.n |
|
69 | 69 | adding savanah/undo.py |
|
70 | 70 | adding store/C\xc3\xa9lesteVille_is_a_Capital_City (esc) |
|
71 | 71 | adding store/foo.d |
|
72 | 72 | adding store/foo.i |
|
73 | 73 | adding store/foo.n |
|
74 | 74 | adding store/undo.babar |
|
75 | 75 | adding store/undo.d |
|
76 | 76 | adding store/undo.foo.d |
|
77 | 77 | adding store/undo.foo.i |
|
78 | 78 | adding store/undo.foo.n |
|
79 | 79 | adding store/undo.i |
|
80 | 80 | adding store/undo.n |
|
81 | 81 | adding store/undo.py |
|
82 | 82 | adding undo.babar |
|
83 | 83 | adding undo.d |
|
84 | 84 | adding undo.foo.d |
|
85 | 85 | adding undo.foo.i |
|
86 | 86 | adding undo.foo.n |
|
87 | 87 | adding undo.i |
|
88 | 88 | adding undo.n |
|
89 | 89 | adding undo.py |
|
90 | 90 | |
|
91 | 91 | $ hg --config server.uncompressed=false serve -p $HGPORT -d --pid-file=hg.pid |
|
92 | 92 | $ cat hg.pid > $DAEMON_PIDS |
|
93 | 93 | $ cd .. |
|
94 | 94 | |
|
95 | 95 | Check local clone |
|
96 | 96 | ================== |
|
97 | 97 | |
|
98 | 98 | The logic is close enough of uncompressed. |
|
99 | 99 | This is present here to reuse the testing around file with "special" names. |
|
100 | 100 | |
|
101 | 101 | $ hg clone server local-clone |
|
102 | 102 | updating to branch default |
|
103 | 103 | 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
104 | 104 | |
|
105 | 105 | Check that the clone went well |
|
106 | 106 | |
|
107 | 107 | $ hg verify -R local-clone -q |
|
108 | 108 | |
|
109 | 109 | Check uncompressed |
|
110 | 110 | ================== |
|
111 | 111 | |
|
112 | 112 | Cannot stream clone when server.uncompressed is set to false |
|
113 | 113 | ------------------------------------------------------------ |
|
114 | 114 | |
|
115 | 115 | When `server.uncompressed` is disabled, the client should fallback to a bundle |
|
116 | 116 | based clone with a warning. |
|
117 | 117 | |
|
118 | 118 | |
|
119 | 119 | $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=stream_out' |
|
120 | 120 | 200 Script output follows |
|
121 | 121 | |
|
122 | 122 | 1 |
|
123 | 123 | |
|
124 | 124 | $ hg debugcapabilities http://localhost:$HGPORT |
|
125 | 125 | Main capabilities: |
|
126 | 126 | batch |
|
127 | 127 | branchmap |
|
128 | 128 | $USUAL_BUNDLE2_CAPS_SERVER$ |
|
129 | 129 | changegroupsubset |
|
130 | 130 | compression=$BUNDLE2_COMPRESSIONS$ |
|
131 | 131 | getbundle |
|
132 | 132 | httpheader=1024 |
|
133 | 133 | httpmediatype=0.1rx,0.1tx,0.2tx |
|
134 | 134 | known |
|
135 | 135 | lookup |
|
136 | 136 | pushkey |
|
137 | 137 | unbundle=HG10GZ,HG10BZ,HG10UN |
|
138 | 138 | unbundlehash |
|
139 | 139 | Bundle2 capabilities: |
|
140 | 140 | HG20 |
|
141 | 141 | bookmarks |
|
142 | 142 | changegroup |
|
143 | 143 | 01 |
|
144 | 144 | 02 |
|
145 | 145 | 03 |
|
146 | 146 | checkheads |
|
147 | 147 | related |
|
148 | 148 | digests |
|
149 | 149 | md5 |
|
150 | 150 | sha1 |
|
151 | 151 | sha512 |
|
152 | 152 | error |
|
153 | 153 | abort |
|
154 | 154 | unsupportedcontent |
|
155 | 155 | pushraced |
|
156 | 156 | pushkey |
|
157 | 157 | hgtagsfnodes |
|
158 | 158 | listkeys |
|
159 | 159 | phases |
|
160 | 160 | heads |
|
161 | 161 | pushkey |
|
162 | 162 | remote-changegroup |
|
163 | 163 | http |
|
164 | 164 | https |
|
165 | 165 | |
|
166 | 166 | $ hg clone --stream -U http://localhost:$HGPORT server-disabled |
|
167 | 167 | warning: stream clone requested but server has them disabled |
|
168 | 168 | requesting all changes |
|
169 | 169 | adding changesets |
|
170 | 170 | adding manifests |
|
171 | 171 | adding file changes |
|
172 | 172 | added 3 changesets with 1088 changes to 1088 files |
|
173 | 173 | new changesets 96ee1d7354c4:5223b5e3265f |
|
174 | 174 | |
|
175 | 175 | $ killdaemons.py |
|
176 | 176 | $ cd server |
|
177 | 177 | $ hg serve -p $HGPORT -d --pid-file=hg.pid --error errors.txt |
|
178 | 178 | $ cat hg.pid > $DAEMON_PIDS |
|
179 | 179 | $ cd .. |
|
180 | 180 | |
|
181 | 181 | Basic clone |
|
182 | 182 | ----------- |
|
183 | 183 | |
|
184 | 184 | Check that --stream trigger a stream clone and result in a valid repositoty |
|
185 | 185 | |
|
186 | 186 | We check the associated output for exact bytes on file number as changes in |
|
187 | 187 | these value implies changes in the data transfered and can detect unintended |
|
188 | 188 | changes in the process. |
|
189 | 189 | |
|
190 | 190 | #if stream-legacy |
|
191 | 191 | $ hg clone --stream -U http://localhost:$HGPORT clone1 |
|
192 | 192 | streaming all changes |
|
193 | 193 | 1091 files to transfer, 102 KB of data (no-zstd !) |
|
194 | 194 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
195 | 195 | 1091 files to transfer, 98.8 KB of data (zstd !) |
|
196 | 196 | transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !) |
|
197 | 197 | searching for changes |
|
198 | 198 | no changes found |
|
199 | 199 | #endif |
|
200 | 200 | #if stream-bundle2-v2 |
|
201 | 201 | $ hg clone --stream -U http://localhost:$HGPORT clone1 |
|
202 | 202 | streaming all changes |
|
203 | 203 | 1094 files to transfer, 102 KB of data (no-zstd !) |
|
204 | 204 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
205 | 205 | 1094 files to transfer, 98.9 KB of data (zstd no-rust !) |
|
206 | 206 | transferred 98.9 KB in * seconds (* */sec) (glob) (zstd no-rust !) |
|
207 | 207 | 1096 files to transfer, 99.0 KB of data (zstd rust !) |
|
208 | 208 | transferred 99.0 KB in * seconds (* */sec) (glob) (zstd rust !) |
|
209 | 209 | #endif |
|
210 | 210 | |
|
211 | 211 | #if stream-bundle2-v3 |
|
212 | 212 | $ hg clone --stream -U http://localhost:$HGPORT clone1 |
|
213 | 213 | streaming all changes |
|
214 | 214 | 1093 entries to transfer |
|
215 | 215 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
216 | 216 | transferred 98.9 KB in * seconds (* */sec) (glob) (zstd no-rust !) |
|
217 | 217 | transferred 99.0 KB in * seconds (* */sec) (glob) (zstd rust !) |
|
218 | 218 | #endif |
|
219 | 219 | |
|
220 | 220 | #if no-stream-legacy |
|
221 | 221 | $ ls -1 clone1/.hg/cache |
|
222 | 222 | branch2-base |
|
223 | 223 | branch2-immutable |
|
224 | 224 | branch2-served |
|
225 | 225 | branch2-served.hidden |
|
226 | 226 | branch2-visible |
|
227 | 227 | branch2-visible-hidden |
|
228 | 228 | rbc-names-v1 |
|
229 | 229 | rbc-revs-v1 |
|
230 | 230 | tags2 |
|
231 | 231 | tags2-served |
|
232 | 232 | #endif |
|
233 | 233 | |
|
234 | 234 | $ hg -R clone1 verify --quiet |
|
235 | 235 | $ cat server/errors.txt |
|
236 | 236 | |
|
237 | 237 | getbundle requests with stream=1 are uncompressed |
|
238 | 238 | ------------------------------------------------- |
|
239 | 239 | |
|
240 | 240 | We check that `getbundle` will return a stream bundle when requested. |
|
241 | 241 | |
|
242 | 242 | XXX manually building the --requestheader is fragile and will drift away from actual usage |
|
243 | 243 | |
|
244 | 244 | $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto '0.1 0.2 comp=zlib,none' --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Astream%253Dv2&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1" |
|
245 | 245 | 200 Script output follows |
|
246 | 246 | content-type: application/mercurial-0.2 |
|
247 | 247 | |
|
248 | 248 | |
|
249 | 249 | $ f --size --hex --bytes 48 body |
|
250 | 250 | body: size=* (glob) |
|
251 | 251 | 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| |
|
252 | 252 | 0010: ?? 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |?.STREAM2.......| (glob) |
|
253 | 253 | 0020: 06 09 04 0c ?? 62 79 74 65 63 6f 75 6e 74 31 30 |....?bytecount10| (glob) |
|
254 | 254 | |
|
255 | 255 | --uncompressed is an alias to --stream |
|
256 | 256 | --------------------------------------- |
|
257 | 257 | |
|
258 | 258 | The alias flag should trigger a stream clone too. |
|
259 | 259 | |
|
260 | 260 | $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed |
|
261 | 261 | streaming all changes |
|
262 | 262 | * files to transfer* (glob) (no-stream-bundle2-v3 !) |
|
263 | 263 | * entries to transfer (glob) (stream-bundle2-v3 !) |
|
264 | 264 | transferred * KB in * seconds (* */sec) (glob) |
|
265 | 265 | searching for changes (stream-legacy !) |
|
266 | 266 | no changes found (stream-legacy !) |
|
267 | 267 | |
|
268 | 268 | Clone with background file closing enabled |
|
269 | ------------------------------------------- | |
|
269 | 270 | |
|
270 | #if stream-legacy | |
|
271 | $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding | |
|
272 | using http://localhost:$HGPORT/ | |
|
273 | sending capabilities command | |
|
274 | sending branchmap command | |
|
275 | streaming all changes | |
|
276 | sending stream_out command | |
|
277 | 1091 files to transfer, 102 KB of data (no-zstd !) | |
|
278 | 1091 files to transfer, 98.8 KB of data (zstd !) | |
|
279 | starting 4 threads for background file closing | |
|
280 | updating the branch cache | |
|
281 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) | |
|
282 | transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !) | |
|
283 | query 1; heads | |
|
284 | sending batch command | |
|
285 | searching for changes | |
|
286 | all remote heads known locally | |
|
287 | no changes found | |
|
288 | sending getbundle command | |
|
289 | bundle2-input-bundle: with-transaction | |
|
290 | bundle2-input-part: "listkeys" (params: 1 mandatory) supported | |
|
291 | bundle2-input-part: "phase-heads" supported | |
|
292 | bundle2-input-part: total payload size 24 | |
|
293 | bundle2-input-bundle: 2 parts total | |
|
294 | checking for updated bookmarks | |
|
295 | updating the branch cache | |
|
296 | (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob) | |
|
297 | #endif | |
|
298 | #if stream-bundle2-v2 | |
|
299 | $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding | |
|
300 | using http://localhost:$HGPORT/ | |
|
301 | sending capabilities command | |
|
302 | query 1; heads | |
|
303 | sending batch command | |
|
304 | streaming all changes | |
|
305 | sending getbundle command | |
|
306 | bundle2-input-bundle: with-transaction | |
|
307 | bundle2-input-part: "stream2" (params: 3 mandatory) supported | |
|
308 | applying stream bundle | |
|
309 | 1094 files to transfer, 102 KB of data (no-zstd !) | |
|
310 | 1094 files to transfer, 98.9 KB of data (zstd no-rust !) | |
|
311 | 1096 files to transfer, 99.0 KB of data (zstd rust !) | |
|
312 | starting 4 threads for background file closing | |
|
271 | The backgound file closing logic should trigger when configured to do so, and | |
|
272 | the result should be a valid repository. | |
|
273 | ||
|
274 | $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep "background file closing" | |
|
313 | 275 | starting 4 threads for background file closing |
|
314 | updating the branch cache | |
|
315 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) | |
|
316 | bundle2-input-part: total payload size 119001 (no-zstd !) | |
|
317 | transferred 98.9 KB in * seconds (* */sec) (glob) (zstd no-rust !) | |
|
318 | transferred 99.0 KB in * seconds (* */sec) (glob) (zstd rust !) | |
|
319 | bundle2-input-part: total payload size 116162 (zstd no-bigendian no-rust !) | |
|
320 | bundle2-input-part: total payload size 116330 (zstd no-bigendian rust !) | |
|
321 | bundle2-input-part: total payload size 116157 (zstd bigendian no-rust !) | |
|
322 | bundle2-input-part: total payload size 116325 (zstd bigendian rust !) | |
|
323 | bundle2-input-part: "listkeys" (params: 1 mandatory) supported | |
|
324 | bundle2-input-bundle: 2 parts total | |
|
325 | checking for updated bookmarks | |
|
326 | updating the branch cache | |
|
327 | (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob) | |
|
328 | #endif | |
|
329 | #if stream-bundle2-v3 | |
|
330 | $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding | |
|
331 | using http://localhost:$HGPORT/ | |
|
332 | sending capabilities command | |
|
333 | query 1; heads | |
|
334 | sending batch command | |
|
335 | streaming all changes | |
|
336 | sending getbundle command | |
|
337 | bundle2-input-bundle: with-transaction | |
|
338 | bundle2-input-part: "stream3-exp" (params: 1 mandatory) supported | |
|
339 | applying stream bundle | |
|
340 | 1093 entries to transfer | |
|
341 | starting 4 threads for background file closing | |
|
342 | starting 4 threads for background file closing | |
|
343 | updating the branch cache | |
|
344 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) | |
|
345 | bundle2-input-part: total payload size 120096 (no-zstd !) | |
|
346 | transferred 98.9 KB in * seconds (* */sec) (glob) (zstd no-rust !) | |
|
347 | transferred 99.0 KB in * seconds (* */sec) (glob) (zstd rust !) | |
|
348 | bundle2-input-part: total payload size 117257 (zstd no-rust no-bigendian !) | |
|
349 | bundle2-input-part: total payload size 117425 (zstd rust no-bigendian !) | |
|
350 | bundle2-input-part: total payload size 117252 (zstd bigendian no-rust !) | |
|
351 | bundle2-input-part: total payload size 117420 (zstd bigendian rust !) | |
|
352 | bundle2-input-part: "listkeys" (params: 1 mandatory) supported | |
|
353 | bundle2-input-bundle: 2 parts total | |
|
354 | checking for updated bookmarks | |
|
355 | updating the branch cache | |
|
356 | (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob) | |
|
357 | #endif | |
|
276 | starting 4 threads for background file closing (no-stream-legacy !) | |
|
277 | $ hg verify -R clone-background --quiet | |
|
358 | 278 |
|
|
359 | 279 | Cannot stream clone when there are secret changesets |
|
360 | 280 | |
|
361 | 281 | $ hg -R server phase --force --secret -r tip |
|
362 | 282 | $ hg clone --stream -U http://localhost:$HGPORT secret-denied |
|
363 | 283 | warning: stream clone requested but server has them disabled |
|
364 | 284 | requesting all changes |
|
365 | 285 | adding changesets |
|
366 | 286 | adding manifests |
|
367 | 287 | adding file changes |
|
368 | 288 | added 2 changesets with 1025 changes to 1025 files |
|
369 | 289 | new changesets 96ee1d7354c4:c17445101a72 |
|
370 | 290 | |
|
371 | 291 | $ killdaemons.py |
|
372 | 292 | |
|
373 | 293 | Streaming of secrets can be overridden by server config |
|
374 | 294 | |
|
375 | 295 | $ cd server |
|
376 | 296 | $ hg serve --config server.uncompressedallowsecret=true -p $HGPORT -d --pid-file=hg.pid |
|
377 | 297 | $ cat hg.pid > $DAEMON_PIDS |
|
378 | 298 | $ cd .. |
|
379 | 299 | |
|
380 | 300 | #if stream-legacy |
|
381 | 301 | $ hg clone --stream -U http://localhost:$HGPORT secret-allowed |
|
382 | 302 | streaming all changes |
|
383 | 303 | 1091 files to transfer, 102 KB of data (no-zstd !) |
|
384 | 304 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
385 | 305 | 1091 files to transfer, 98.8 KB of data (zstd !) |
|
386 | 306 | transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !) |
|
387 | 307 | searching for changes |
|
388 | 308 | no changes found |
|
389 | 309 | #endif |
|
390 | 310 | #if stream-bundle2-v2 |
|
391 | 311 | $ hg clone --stream -U http://localhost:$HGPORT secret-allowed |
|
392 | 312 | streaming all changes |
|
393 | 313 | 1094 files to transfer, 102 KB of data (no-zstd !) |
|
394 | 314 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
395 | 315 | 1094 files to transfer, 98.9 KB of data (zstd no-rust !) |
|
396 | 316 | transferred 98.9 KB in * seconds (* */sec) (glob) (zstd no-rust !) |
|
397 | 317 | 1096 files to transfer, 99.0 KB of data (zstd rust !) |
|
398 | 318 | transferred 99.0 KB in * seconds (* */sec) (glob) (zstd rust !) |
|
399 | 319 | #endif |
|
400 | 320 | #if stream-bundle2-v3 |
|
401 | 321 | $ hg clone --stream -U http://localhost:$HGPORT secret-allowed |
|
402 | 322 | streaming all changes |
|
403 | 323 | 1093 entries to transfer |
|
404 | 324 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
405 | 325 | transferred 98.9 KB in * seconds (* */sec) (glob) (zstd no-rust !) |
|
406 | 326 | transferred 99.0 KB in * seconds (* */sec) (glob) (zstd rust !) |
|
407 | 327 | #endif |
|
408 | 328 | |
|
409 | 329 | $ killdaemons.py |
|
410 | 330 | |
|
411 | 331 | Verify interaction between preferuncompressed and secret presence |
|
412 | 332 | |
|
413 | 333 | $ cd server |
|
414 | 334 | $ hg serve --config server.preferuncompressed=true -p $HGPORT -d --pid-file=hg.pid |
|
415 | 335 | $ cat hg.pid > $DAEMON_PIDS |
|
416 | 336 | $ cd .. |
|
417 | 337 | |
|
418 | 338 | $ hg clone -U http://localhost:$HGPORT preferuncompressed-secret |
|
419 | 339 | requesting all changes |
|
420 | 340 | adding changesets |
|
421 | 341 | adding manifests |
|
422 | 342 | adding file changes |
|
423 | 343 | added 2 changesets with 1025 changes to 1025 files |
|
424 | 344 | new changesets 96ee1d7354c4:c17445101a72 |
|
425 | 345 | |
|
426 | 346 | $ killdaemons.py |
|
427 | 347 | |
|
428 | 348 | Clone not allowed when full bundles disabled and can't serve secrets |
|
429 | 349 | |
|
430 | 350 | $ cd server |
|
431 | 351 | $ hg serve --config server.disablefullbundle=true -p $HGPORT -d --pid-file=hg.pid |
|
432 | 352 | $ cat hg.pid > $DAEMON_PIDS |
|
433 | 353 | $ cd .. |
|
434 | 354 | |
|
435 | 355 | $ hg clone --stream http://localhost:$HGPORT secret-full-disabled |
|
436 | 356 | warning: stream clone requested but server has them disabled |
|
437 | 357 | requesting all changes |
|
438 | 358 | remote: abort: server has pull-based clones disabled |
|
439 | 359 | abort: pull failed on remote |
|
440 | 360 | (remove --pull if specified or upgrade Mercurial) |
|
441 | 361 | [100] |
|
442 | 362 | |
|
443 | 363 | Local stream clone with secrets involved |
|
444 | 364 | (This is just a test over behavior: if you have access to the repo's files, |
|
445 | 365 | there is no security so it isn't important to prevent a clone here.) |
|
446 | 366 | |
|
447 | 367 | $ hg clone -U --stream server local-secret |
|
448 | 368 | warning: stream clone requested but server has them disabled |
|
449 | 369 | requesting all changes |
|
450 | 370 | adding changesets |
|
451 | 371 | adding manifests |
|
452 | 372 | adding file changes |
|
453 | 373 | added 2 changesets with 1025 changes to 1025 files |
|
454 | 374 | new changesets 96ee1d7354c4:c17445101a72 |
|
455 | 375 | |
|
456 | 376 | Stream clone while repo is changing: |
|
457 | 377 | |
|
458 | 378 | $ mkdir changing |
|
459 | 379 | $ cd changing |
|
460 | 380 | |
|
461 | 381 | prepare repo with small and big file to cover both code paths in emitrevlogdata |
|
462 | 382 | |
|
463 | 383 | $ hg init repo |
|
464 | 384 | $ touch repo/f1 |
|
465 | 385 | $ $TESTDIR/seq.py 50000 > repo/f2 |
|
466 | 386 | $ hg -R repo ci -Aqm "0" |
|
467 | 387 | $ HG_TEST_STREAM_WALKED_FILE_1="$TESTTMP/sync_file_walked_1" |
|
468 | 388 | $ export HG_TEST_STREAM_WALKED_FILE_1 |
|
469 | 389 | $ HG_TEST_STREAM_WALKED_FILE_2="$TESTTMP/sync_file_walked_2" |
|
470 | 390 | $ export HG_TEST_STREAM_WALKED_FILE_2 |
|
471 | 391 | $ HG_TEST_STREAM_WALKED_FILE_3="$TESTTMP/sync_file_walked_3" |
|
472 | 392 | $ export HG_TEST_STREAM_WALKED_FILE_3 |
|
473 | 393 | # $ cat << EOF >> $HGRCPATH |
|
474 | 394 | # > [hooks] |
|
475 | 395 | # > pre-clone=rm -f "$TESTTMP/sync_file_walked_*" |
|
476 | 396 | # > EOF |
|
477 | 397 | $ hg serve -R repo -p $HGPORT1 -d --error errors.log --pid-file=hg.pid --config extensions.stream_steps="$RUNTESTDIR/testlib/ext-stream-clone-steps.py" |
|
478 | 398 | $ cat hg.pid >> $DAEMON_PIDS |
|
479 | 399 | |
|
480 | 400 | clone while modifying the repo between stating file with write lock and |
|
481 | 401 | actually serving file content |
|
482 | 402 | |
|
483 | 403 | $ (hg clone -q --stream -U http://localhost:$HGPORT1 clone; touch "$HG_TEST_STREAM_WALKED_FILE_3") & |
|
484 | 404 | $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_1 |
|
485 | 405 | $ echo >> repo/f1 |
|
486 | 406 | $ echo >> repo/f2 |
|
487 | 407 | $ hg -R repo ci -m "1" --config ui.timeout.warn=-1 |
|
488 | 408 | $ touch $HG_TEST_STREAM_WALKED_FILE_2 |
|
489 | 409 | $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_3 |
|
490 | 410 | $ hg -R clone id |
|
491 | 411 | 000000000000 |
|
492 | 412 | $ cat errors.log |
|
493 | 413 | $ cd .. |
|
494 | 414 | |
|
495 | 415 | Stream repository with bookmarks |
|
496 | 416 | -------------------------------- |
|
497 | 417 | |
|
498 | 418 | (revert introduction of secret changeset) |
|
499 | 419 | |
|
500 | 420 | $ hg -R server phase --draft 'secret()' |
|
501 | 421 | |
|
502 | 422 | add a bookmark |
|
503 | 423 | |
|
504 | 424 | $ hg -R server bookmark -r tip some-bookmark |
|
505 | 425 | |
|
506 | 426 | clone it |
|
507 | 427 | |
|
508 | 428 | #if stream-legacy |
|
509 | 429 | $ hg clone --stream http://localhost:$HGPORT with-bookmarks |
|
510 | 430 | streaming all changes |
|
511 | 431 | 1091 files to transfer, 102 KB of data (no-zstd !) |
|
512 | 432 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
513 | 433 | 1091 files to transfer, 98.8 KB of data (zstd !) |
|
514 | 434 | transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !) |
|
515 | 435 | searching for changes |
|
516 | 436 | no changes found |
|
517 | 437 | updating to branch default |
|
518 | 438 | 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
519 | 439 | #endif |
|
520 | 440 | #if stream-bundle2-v2 |
|
521 | 441 | $ hg clone --stream http://localhost:$HGPORT with-bookmarks |
|
522 | 442 | streaming all changes |
|
523 | 443 | 1097 files to transfer, 102 KB of data (no-zstd !) |
|
524 | 444 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
525 | 445 | 1097 files to transfer, 99.1 KB of data (zstd no-rust !) |
|
526 | 446 | transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !) |
|
527 | 447 | 1099 files to transfer, 99.2 KB of data (zstd rust !) |
|
528 | 448 | transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !) |
|
529 | 449 | updating to branch default |
|
530 | 450 | 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
531 | 451 | #endif |
|
532 | 452 | #if stream-bundle2-v3 |
|
533 | 453 | $ hg clone --stream http://localhost:$HGPORT with-bookmarks |
|
534 | 454 | streaming all changes |
|
535 | 455 | 1096 entries to transfer |
|
536 | 456 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
537 | 457 | transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !) |
|
538 | 458 | transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !) |
|
539 | 459 | updating to branch default |
|
540 | 460 | 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
541 | 461 | #endif |
|
542 | 462 | $ hg verify -R with-bookmarks -q |
|
543 | 463 | $ hg -R with-bookmarks bookmarks |
|
544 | 464 | some-bookmark 2:5223b5e3265f |
|
545 | 465 | |
|
546 | 466 | Stream repository with phases |
|
547 | 467 | ----------------------------- |
|
548 | 468 | |
|
549 | 469 | Clone as publishing |
|
550 | 470 | |
|
551 | 471 | $ hg -R server phase -r 'all()' |
|
552 | 472 | 0: draft |
|
553 | 473 | 1: draft |
|
554 | 474 | 2: draft |
|
555 | 475 | |
|
556 | 476 | #if stream-legacy |
|
557 | 477 | $ hg clone --stream http://localhost:$HGPORT phase-publish |
|
558 | 478 | streaming all changes |
|
559 | 479 | 1091 files to transfer, 102 KB of data (no-zstd !) |
|
560 | 480 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
561 | 481 | 1091 files to transfer, 98.8 KB of data (zstd !) |
|
562 | 482 | transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !) |
|
563 | 483 | searching for changes |
|
564 | 484 | no changes found |
|
565 | 485 | updating to branch default |
|
566 | 486 | 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
567 | 487 | #endif |
|
568 | 488 | #if stream-bundle2-v2 |
|
569 | 489 | $ hg clone --stream http://localhost:$HGPORT phase-publish |
|
570 | 490 | streaming all changes |
|
571 | 491 | 1097 files to transfer, 102 KB of data (no-zstd !) |
|
572 | 492 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
573 | 493 | 1097 files to transfer, 99.1 KB of data (zstd no-rust !) |
|
574 | 494 | transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !) |
|
575 | 495 | 1099 files to transfer, 99.2 KB of data (zstd rust !) |
|
576 | 496 | transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !) |
|
577 | 497 | updating to branch default |
|
578 | 498 | 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
579 | 499 | #endif |
|
580 | 500 | #if stream-bundle2-v3 |
|
581 | 501 | $ hg clone --stream http://localhost:$HGPORT phase-publish |
|
582 | 502 | streaming all changes |
|
583 | 503 | 1096 entries to transfer |
|
584 | 504 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
585 | 505 | transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !) |
|
586 | 506 | transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !) |
|
587 | 507 | updating to branch default |
|
588 | 508 | 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
589 | 509 | #endif |
|
590 | 510 | $ hg verify -R phase-publish -q |
|
591 | 511 | $ hg -R phase-publish phase -r 'all()' |
|
592 | 512 | 0: public |
|
593 | 513 | 1: public |
|
594 | 514 | 2: public |
|
595 | 515 | |
|
596 | 516 | Clone as non publishing |
|
597 | 517 | |
|
598 | 518 | $ cat << EOF >> server/.hg/hgrc |
|
599 | 519 | > [phases] |
|
600 | 520 | > publish = False |
|
601 | 521 | > EOF |
|
602 | 522 | $ killdaemons.py |
|
603 | 523 | $ hg -R server serve -p $HGPORT -d --pid-file=hg.pid |
|
604 | 524 | $ cat hg.pid > $DAEMON_PIDS |
|
605 | 525 | |
|
606 | 526 | #if stream-legacy |
|
607 | 527 | |
|
608 | 528 | With v1 of the stream protocol, changeset are always cloned as public. It make |
|
609 | 529 | stream v1 unsuitable for non-publishing repository. |
|
610 | 530 | |
|
611 | 531 | $ hg clone --stream http://localhost:$HGPORT phase-no-publish |
|
612 | 532 | streaming all changes |
|
613 | 533 | 1091 files to transfer, 102 KB of data (no-zstd !) |
|
614 | 534 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
615 | 535 | 1091 files to transfer, 98.8 KB of data (zstd !) |
|
616 | 536 | transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !) |
|
617 | 537 | searching for changes |
|
618 | 538 | no changes found |
|
619 | 539 | updating to branch default |
|
620 | 540 | 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
621 | 541 | $ hg -R phase-no-publish phase -r 'all()' |
|
622 | 542 | 0: public |
|
623 | 543 | 1: public |
|
624 | 544 | 2: public |
|
625 | 545 | #endif |
|
626 | 546 | #if stream-bundle2-v2 |
|
627 | 547 | $ hg clone --stream http://localhost:$HGPORT phase-no-publish |
|
628 | 548 | streaming all changes |
|
629 | 549 | 1098 files to transfer, 102 KB of data (no-zstd !) |
|
630 | 550 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
631 | 551 | 1098 files to transfer, 99.1 KB of data (zstd no-rust !) |
|
632 | 552 | transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !) |
|
633 | 553 | 1100 files to transfer, 99.2 KB of data (zstd rust !) |
|
634 | 554 | transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !) |
|
635 | 555 | updating to branch default |
|
636 | 556 | 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
637 | 557 | $ hg -R phase-no-publish phase -r 'all()' |
|
638 | 558 | 0: draft |
|
639 | 559 | 1: draft |
|
640 | 560 | 2: draft |
|
641 | 561 | #endif |
|
642 | 562 | #if stream-bundle2-v3 |
|
643 | 563 | $ hg clone --stream http://localhost:$HGPORT phase-no-publish |
|
644 | 564 | streaming all changes |
|
645 | 565 | 1097 entries to transfer |
|
646 | 566 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
647 | 567 | transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !) |
|
648 | 568 | transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !) |
|
649 | 569 | updating to branch default |
|
650 | 570 | 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
651 | 571 | $ hg -R phase-no-publish phase -r 'all()' |
|
652 | 572 | 0: draft |
|
653 | 573 | 1: draft |
|
654 | 574 | 2: draft |
|
655 | 575 | #endif |
|
656 | 576 | $ hg verify -R phase-no-publish -q |
|
657 | 577 | |
|
658 | 578 | $ killdaemons.py |
|
659 | 579 | |
|
660 | 580 | #if stream-legacy |
|
661 | 581 | |
|
662 | 582 | With v1 of the stream protocol, changeset are always cloned as public. There's |
|
663 | 583 | no obsolescence markers exchange in stream v1. |
|
664 | 584 | |
|
665 | 585 | #endif |
|
666 | 586 | #if stream-bundle2-v2 |
|
667 | 587 | |
|
668 | 588 | Stream repository with obsolescence |
|
669 | 589 | ----------------------------------- |
|
670 | 590 | |
|
671 | 591 | Clone non-publishing with obsolescence |
|
672 | 592 | |
|
673 | 593 | $ cat >> $HGRCPATH << EOF |
|
674 | 594 | > [experimental] |
|
675 | 595 | > evolution=all |
|
676 | 596 | > EOF |
|
677 | 597 | |
|
678 | 598 | $ cd server |
|
679 | 599 | $ echo foo > foo |
|
680 | 600 | $ hg -q commit -m 'about to be pruned' |
|
681 | 601 | $ hg debugobsolete `hg log -r . -T '{node}'` -d '0 0' -u test --record-parents |
|
682 | 602 | 1 new obsolescence markers |
|
683 | 603 | obsoleted 1 changesets |
|
684 | 604 | $ hg up null -q |
|
685 | 605 | $ hg log -T '{rev}: {phase}\n' |
|
686 | 606 | 2: draft |
|
687 | 607 | 1: draft |
|
688 | 608 | 0: draft |
|
689 | 609 | $ hg serve -p $HGPORT -d --pid-file=hg.pid |
|
690 | 610 | $ cat hg.pid > $DAEMON_PIDS |
|
691 | 611 | $ cd .. |
|
692 | 612 | |
|
693 | 613 | $ hg clone -U --stream http://localhost:$HGPORT with-obsolescence |
|
694 | 614 | streaming all changes |
|
695 | 615 | 1099 files to transfer, 102 KB of data (no-zstd !) |
|
696 | 616 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
697 | 617 | 1099 files to transfer, 99.5 KB of data (zstd no-rust !) |
|
698 | 618 | transferred 99.5 KB in * seconds (* */sec) (glob) (zstd no-rust !) |
|
699 | 619 | 1101 files to transfer, 99.6 KB of data (zstd rust !) |
|
700 | 620 | transferred 99.6 KB in * seconds (* */sec) (glob) (zstd rust !) |
|
701 | 621 | $ hg -R with-obsolescence log -T '{rev}: {phase}\n' |
|
702 | 622 | 2: draft |
|
703 | 623 | 1: draft |
|
704 | 624 | 0: draft |
|
705 | 625 | $ hg debugobsolete -R with-obsolescence |
|
706 | 626 | 8c206a663911c1f97f2f9d7382e417ae55872cfa 0 {5223b5e3265f0df40bb743da62249413d74ac70f} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
707 | 627 | $ hg verify -R with-obsolescence -q |
|
708 | 628 | |
|
709 | 629 | $ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution |
|
710 | 630 | streaming all changes |
|
711 | 631 | remote: abort: server has obsolescence markers, but client cannot receive them via stream clone |
|
712 | 632 | abort: pull failed on remote |
|
713 | 633 | [100] |
|
714 | 634 | |
|
715 | 635 | $ killdaemons.py |
|
716 | 636 | |
|
717 | 637 | #endif |
|
718 | 638 | #if stream-bundle2-v3 |
|
719 | 639 | |
|
720 | 640 | Stream repository with obsolescence |
|
721 | 641 | ----------------------------------- |
|
722 | 642 | |
|
723 | 643 | Clone non-publishing with obsolescence |
|
724 | 644 | |
|
725 | 645 | $ cat >> $HGRCPATH << EOF |
|
726 | 646 | > [experimental] |
|
727 | 647 | > evolution=all |
|
728 | 648 | > EOF |
|
729 | 649 | |
|
730 | 650 | $ cd server |
|
731 | 651 | $ echo foo > foo |
|
732 | 652 | $ hg -q commit -m 'about to be pruned' |
|
733 | 653 | $ hg debugobsolete `hg log -r . -T '{node}'` -d '0 0' -u test --record-parents |
|
734 | 654 | 1 new obsolescence markers |
|
735 | 655 | obsoleted 1 changesets |
|
736 | 656 | $ hg up null -q |
|
737 | 657 | $ hg log -T '{rev}: {phase}\n' |
|
738 | 658 | 2: draft |
|
739 | 659 | 1: draft |
|
740 | 660 | 0: draft |
|
741 | 661 | $ hg serve -p $HGPORT -d --pid-file=hg.pid |
|
742 | 662 | $ cat hg.pid > $DAEMON_PIDS |
|
743 | 663 | $ cd .. |
|
744 | 664 | |
|
745 | 665 | $ hg clone -U --stream http://localhost:$HGPORT with-obsolescence |
|
746 | 666 | streaming all changes |
|
747 | 667 | 1098 entries to transfer |
|
748 | 668 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
749 | 669 | transferred 99.5 KB in * seconds (* */sec) (glob) (zstd no-rust !) |
|
750 | 670 | transferred 99.6 KB in * seconds (* */sec) (glob) (zstd rust !) |
|
751 | 671 | $ hg -R with-obsolescence log -T '{rev}: {phase}\n' |
|
752 | 672 | 2: draft |
|
753 | 673 | 1: draft |
|
754 | 674 | 0: draft |
|
755 | 675 | $ hg debugobsolete -R with-obsolescence |
|
756 | 676 | 8c206a663911c1f97f2f9d7382e417ae55872cfa 0 {5223b5e3265f0df40bb743da62249413d74ac70f} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
757 | 677 | $ hg verify -R with-obsolescence -q |
|
758 | 678 | |
|
759 | 679 | $ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution |
|
760 | 680 | streaming all changes |
|
761 | 681 | remote: abort: server has obsolescence markers, but client cannot receive them via stream clone |
|
762 | 682 | abort: pull failed on remote |
|
763 | 683 | [100] |
|
764 | 684 | |
|
765 | 685 | $ killdaemons.py |
|
766 | 686 | |
|
767 | 687 | #endif |
|
768 | 688 | |
|
769 | 689 | Cloning a repo with no requirements doesn't give some obscure error |
|
770 | 690 | |
|
771 | 691 | $ mkdir -p empty-repo/.hg |
|
772 | 692 | $ hg clone -q --stream ssh://user@dummy/empty-repo empty-repo2 |
|
773 | 693 | $ hg --cwd empty-repo2 verify -q |
|
774 | 694 | |
|
775 | 695 | Cloning a repo with an empty manifestlog doesn't give some weird error |
|
776 | 696 | |
|
777 | 697 | $ rm -r empty-repo; hg init empty-repo |
|
778 | 698 | $ (cd empty-repo; touch x; hg commit -Am empty; hg debugstrip -r 0) > /dev/null |
|
779 | 699 | $ hg clone -q --stream ssh://user@dummy/empty-repo empty-repo3 |
|
780 | 700 | $ hg --cwd empty-repo3 verify -q 2>&1 | grep -v warning |
|
781 | 701 | [1] |
|
782 | 702 | |
|
783 | 703 | The warnings filtered out here are talking about zero-length 'orphan' data files. |
|
784 | 704 | Those are harmless, so that's fine. |
|
785 | 705 |
General Comments 0
You need to be logged in to leave comments.
Login now