##// END OF EJS Templates
stream-clone-test: simplify the case testing phases...
marmoute -
r52375:32631657 default
parent child Browse files
Show More
@@ -1,686 +1,638
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
271 271 The backgound file closing logic should trigger when configured to do so, and
272 272 the result should be a valid repository.
273 273
274 274 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep "background file closing"
275 275 starting 4 threads for background file closing
276 276 starting 4 threads for background file closing (no-stream-legacy !)
277 277 $ hg verify -R clone-background --quiet
278 278
279 279 Cannot stream clone when there are secret changesets
280 280 ----------------------------------------------------
281 281
282 282 If secret changeset are present the should not be cloned (by default) and the
283 283 clone falls back to a bundle clone.
284 284
285 285 $ hg -R server phase --force --secret -r tip
286 286 $ hg clone --stream -U http://localhost:$HGPORT secret-denied
287 287 warning: stream clone requested but server has them disabled
288 288 requesting all changes
289 289 adding changesets
290 290 adding manifests
291 291 adding file changes
292 292 added 2 changesets with 1025 changes to 1025 files
293 293 new changesets 96ee1d7354c4:c17445101a72
294 294
295 295 $ killdaemons.py
296 296
297 297 Streaming of secrets can be overridden by server config
298 298 -------------------------------------------------------
299 299
300 300 Secret changeset can still be streamed if the server is configured to do so.
301 301
302 302 $ cd server
303 303 $ hg serve --config server.uncompressedallowsecret=true -p $HGPORT -d --pid-file=hg.pid
304 304 $ cat hg.pid > $DAEMON_PIDS
305 305 $ cd ..
306 306
307 307 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
308 308 streaming all changes
309 309 * files to transfer* (glob) (no-stream-bundle2-v3 !)
310 310 * entries to transfer (glob) (stream-bundle2-v3 !)
311 311 transferred * KB in * seconds (* */sec) (glob)
312 312 searching for changes (stream-legacy !)
313 313 no changes found (stream-legacy !)
314 314
315 315 $ killdaemons.py
316 316
317 317 Verify interaction between preferuncompressed and secret presence
318 318 -----------------------------------------------------------------
319 319
320 320 Secret presence will still make the clone falls back to a normal bundle even if
321 321 the server prefers stream clone.
322 322
323 323 $ cd server
324 324 $ hg serve --config server.preferuncompressed=true -p $HGPORT -d --pid-file=hg.pid
325 325 $ cat hg.pid > $DAEMON_PIDS
326 326 $ cd ..
327 327
328 328 $ hg clone -U http://localhost:$HGPORT preferuncompressed-secret
329 329 requesting all changes
330 330 adding changesets
331 331 adding manifests
332 332 adding file changes
333 333 added 2 changesets with 1025 changes to 1025 files
334 334 new changesets 96ee1d7354c4:c17445101a72
335 335
336 336 $ killdaemons.py
337 337
338 338 Clone not allowed when full bundles disabled and can't serve secrets
339 339 --------------------------------------------------------------------
340 340
341 341 The clone should fail as no valid option is found.
342 342
343 343 $ cd server
344 344 $ hg serve --config server.disablefullbundle=true -p $HGPORT -d --pid-file=hg.pid
345 345 $ cat hg.pid > $DAEMON_PIDS
346 346 $ cd ..
347 347
348 348 $ hg clone --stream http://localhost:$HGPORT secret-full-disabled
349 349 warning: stream clone requested but server has them disabled
350 350 requesting all changes
351 351 remote: abort: server has pull-based clones disabled
352 352 abort: pull failed on remote
353 353 (remove --pull if specified or upgrade Mercurial)
354 354 [100]
355 355
356 356 Local stream clone with secrets involved
357 357 ----------------------------------------
358 358
359 359 (This is just a test over behavior: if you have access to the repo's files,
360 360 there is no security so it isn't important to prevent a clone here.)
361 361
362 362 $ hg clone -U --stream server local-secret
363 363 warning: stream clone requested but server has them disabled
364 364 requesting all changes
365 365 adding changesets
366 366 adding manifests
367 367 adding file changes
368 368 added 2 changesets with 1025 changes to 1025 files
369 369 new changesets 96ee1d7354c4:c17445101a72
370 370
371 371 (revert introduction of secret changeset)
372 372
373 373 $ hg -R server phase --draft 'secret()'
374 374
375 375 Stream clone while repo is changing:
376 376 ------------------------------------
377 377
378 378 We should send a repository in a valid state, ignoring the ongoing transaction.
379 379
380 380 $ mkdir changing
381 381 $ cd changing
382 382
383 383 prepare repo with small and big file to cover both code paths in emitrevlogdata
384 384 (inlined revlog and non-inlined revlogs).
385 385
386 386 $ hg init repo
387 387 $ touch repo/f1
388 388 $ $TESTDIR/seq.py 50000 > repo/f2
389 389 $ hg -R repo ci -Aqm "0"
390 390 $ HG_TEST_STREAM_WALKED_FILE_1="$TESTTMP/sync_file_walked_1"
391 391 $ export HG_TEST_STREAM_WALKED_FILE_1
392 392 $ HG_TEST_STREAM_WALKED_FILE_2="$TESTTMP/sync_file_walked_2"
393 393 $ export HG_TEST_STREAM_WALKED_FILE_2
394 394 $ HG_TEST_STREAM_WALKED_FILE_3="$TESTTMP/sync_file_walked_3"
395 395 $ export HG_TEST_STREAM_WALKED_FILE_3
396 396 # $ cat << EOF >> $HGRCPATH
397 397 # > [hooks]
398 398 # > pre-clone=rm -f "$TESTTMP/sync_file_walked_*"
399 399 # > EOF
400 400 $ 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"
401 401 $ cat hg.pid >> $DAEMON_PIDS
402 402
403 403 clone while modifying the repo between stating file with write lock and
404 404 actually serving file content
405 405
406 406 $ (hg clone -q --stream -U http://localhost:$HGPORT1 clone; touch "$HG_TEST_STREAM_WALKED_FILE_3") &
407 407 $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_1
408 408 $ echo >> repo/f1
409 409 $ echo >> repo/f2
410 410 $ hg -R repo ci -m "1" --config ui.timeout.warn=-1
411 411 $ touch $HG_TEST_STREAM_WALKED_FILE_2
412 412 $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_3
413 413 $ hg -R clone id
414 414 000000000000
415 415 $ hg -R clone verify --quiet
416 416 $ cat errors.log
417 417 $ cd ..
418 418
419 419 Stream repository with bookmarks
420 420 --------------------------------
421 421
422 422 The bookmark file should be send over in the stream bundle.
423 423
424 424 add a bookmark
425 425
426 426 $ hg -R server bookmark -r tip some-bookmark
427 427
428 428 clone it
429 429
430 430 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
431 431 streaming all changes
432 432 1091 files to transfer, * KB of data (glob) (stream-legacy !)
433 433 1097 files to transfer, * KB of data (glob) (stream-bundle2-v2 no-rust !)
434 434 1099 files to transfer, * KB of data (glob) (stream-bundle2-v2 rust !)
435 435 1096 entries to transfer (stream-bundle2-v3 !)
436 436 transferred * KB in * seconds (* */sec) (glob)
437 437 searching for changes (stream-legacy !)
438 438 no changes found (stream-legacy !)
439 439 updating to branch default
440 440 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
441 441 $ hg verify -R with-bookmarks -q
442 442 $ hg -R with-bookmarks bookmarks
443 443 some-bookmark 2:5223b5e3265f
444 444
445 445 Stream repository with phases
446 446 -----------------------------
447 447
448 The file storing phases information (e.g. phaseroots) should be sent as part of
449 the stream bundle.
450
448 451 Clone as publishing
449 452
450 453 $ hg -R server phase -r 'all()'
451 454 0: draft
452 455 1: draft
453 456 2: draft
454 457
455 #if stream-legacy
456 $ hg clone --stream http://localhost:$HGPORT phase-publish
457 streaming all changes
458 1091 files to transfer, 102 KB of data (no-zstd !)
459 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
460 1091 files to transfer, 98.8 KB of data (zstd !)
461 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
462 searching for changes
463 no changes found
464 updating to branch default
465 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
466 #endif
467 #if stream-bundle2-v2
468 458 $ hg clone --stream http://localhost:$HGPORT phase-publish
469 459 streaming all changes
470 1097 files to transfer, 102 KB of data (no-zstd !)
471 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
472 1097 files to transfer, 99.1 KB of data (zstd no-rust !)
473 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !)
474 1099 files to transfer, 99.2 KB of data (zstd rust !)
475 transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !)
460 1091 files to transfer, * KB of data (glob) (stream-legacy !)
461 1097 files to transfer, * KB of data (glob) (stream-bundle2-v2 no-rust !)
462 1099 files to transfer, * KB of data (glob) (stream-bundle2-v2 rust !)
463 1096 entries to transfer (stream-bundle2-v3 !)
464 transferred * KB in * seconds (* */sec) (glob)
465 searching for changes (stream-legacy !)
466 no changes found (stream-legacy !)
476 467 updating to branch default
477 468 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
478 #endif
479 #if stream-bundle2-v3
480 $ hg clone --stream http://localhost:$HGPORT phase-publish
481 streaming all changes
482 1096 entries to transfer
483 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
484 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !)
485 transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !)
486 updating to branch default
487 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
488 #endif
489 469 $ hg verify -R phase-publish -q
490 470 $ hg -R phase-publish phase -r 'all()'
491 471 0: public
492 472 1: public
493 473 2: public
494 474
495 475 Clone as non publishing
496 476
497 477 $ cat << EOF >> server/.hg/hgrc
498 478 > [phases]
499 479 > publish = False
500 480 > EOF
501 481 $ killdaemons.py
502 482 $ hg -R server serve -p $HGPORT -d --pid-file=hg.pid
503 483 $ cat hg.pid > $DAEMON_PIDS
504 484
505 #if stream-legacy
506
507 With v1 of the stream protocol, changeset are always cloned as public. It make
508 stream v1 unsuitable for non-publishing repository.
509
510 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
511 streaming all changes
512 1091 files to transfer, 102 KB of data (no-zstd !)
513 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
514 1091 files to transfer, 98.8 KB of data (zstd !)
515 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
516 searching for changes
517 no changes found
518 updating to branch default
519 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
520 $ hg -R phase-no-publish phase -r 'all()'
521 0: public
522 1: public
523 2: public
524 #endif
525 #if stream-bundle2-v2
526 485 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
527 486 streaming all changes
528 1098 files to transfer, 102 KB of data (no-zstd !)
529 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
530 1098 files to transfer, 99.1 KB of data (zstd no-rust !)
531 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !)
532 1100 files to transfer, 99.2 KB of data (zstd rust !)
533 transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !)
487 1091 files to transfer, * KB of data (glob) (stream-legacy !)
488 1098 files to transfer, * KB of data (glob) (stream-bundle2-v2 no-rust !)
489 1100 files to transfer, * KB of data (glob) (stream-bundle2-v2 rust !)
490 1097 entries to transfer (stream-bundle2-v3 !)
491 transferred * KB in * seconds (* */sec) (glob)
492 searching for changes (stream-legacy !)
493 no changes found (stream-legacy !)
534 494 updating to branch default
535 495 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
496
497 Note: With v1 of the stream protocol, changeset are always cloned as public. It
498 make stream v1 unsuitable for non-publishing repository.
499
536 500 $ hg -R phase-no-publish phase -r 'all()'
537 0: draft
538 1: draft
539 2: draft
540 #endif
541 #if stream-bundle2-v3
542 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
543 streaming all changes
544 1097 entries to transfer
545 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
546 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !)
547 transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !)
548 updating to branch default
549 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
550 $ hg -R phase-no-publish phase -r 'all()'
551 0: draft
552 1: draft
553 2: draft
554 #endif
501 0: public (stream-legacy !)
502 1: public (stream-legacy !)
503 2: public (stream-legacy !)
504 0: draft (no-stream-legacy !)
505 1: draft (no-stream-legacy !)
506 2: draft (no-stream-legacy !)
555 507 $ hg verify -R phase-no-publish -q
556 508
557 509 $ killdaemons.py
558 510
559 511 #if stream-legacy
560 512
561 513 With v1 of the stream protocol, changeset are always cloned as public. There's
562 514 no obsolescence markers exchange in stream v1.
563 515
564 516 #endif
565 517 #if stream-bundle2-v2
566 518
567 519 Stream repository with obsolescence
568 520 -----------------------------------
569 521
570 522 Clone non-publishing with obsolescence
571 523
572 524 $ cat >> $HGRCPATH << EOF
573 525 > [experimental]
574 526 > evolution=all
575 527 > EOF
576 528
577 529 $ cd server
578 530 $ echo foo > foo
579 531 $ hg -q commit -m 'about to be pruned'
580 532 $ hg debugobsolete `hg log -r . -T '{node}'` -d '0 0' -u test --record-parents
581 533 1 new obsolescence markers
582 534 obsoleted 1 changesets
583 535 $ hg up null -q
584 536 $ hg log -T '{rev}: {phase}\n'
585 537 2: draft
586 538 1: draft
587 539 0: draft
588 540 $ hg serve -p $HGPORT -d --pid-file=hg.pid
589 541 $ cat hg.pid > $DAEMON_PIDS
590 542 $ cd ..
591 543
592 544 $ hg clone -U --stream http://localhost:$HGPORT with-obsolescence
593 545 streaming all changes
594 546 1099 files to transfer, 102 KB of data (no-zstd !)
595 547 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
596 548 1099 files to transfer, 99.5 KB of data (zstd no-rust !)
597 549 transferred 99.5 KB in * seconds (* */sec) (glob) (zstd no-rust !)
598 550 1101 files to transfer, 99.6 KB of data (zstd rust !)
599 551 transferred 99.6 KB in * seconds (* */sec) (glob) (zstd rust !)
600 552 $ hg -R with-obsolescence log -T '{rev}: {phase}\n'
601 553 2: draft
602 554 1: draft
603 555 0: draft
604 556 $ hg debugobsolete -R with-obsolescence
605 557 8c206a663911c1f97f2f9d7382e417ae55872cfa 0 {5223b5e3265f0df40bb743da62249413d74ac70f} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
606 558 $ hg verify -R with-obsolescence -q
607 559
608 560 $ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution
609 561 streaming all changes
610 562 remote: abort: server has obsolescence markers, but client cannot receive them via stream clone
611 563 abort: pull failed on remote
612 564 [100]
613 565
614 566 $ killdaemons.py
615 567
616 568 #endif
617 569 #if stream-bundle2-v3
618 570
619 571 Stream repository with obsolescence
620 572 -----------------------------------
621 573
622 574 Clone non-publishing with obsolescence
623 575
624 576 $ cat >> $HGRCPATH << EOF
625 577 > [experimental]
626 578 > evolution=all
627 579 > EOF
628 580
629 581 $ cd server
630 582 $ echo foo > foo
631 583 $ hg -q commit -m 'about to be pruned'
632 584 $ hg debugobsolete `hg log -r . -T '{node}'` -d '0 0' -u test --record-parents
633 585 1 new obsolescence markers
634 586 obsoleted 1 changesets
635 587 $ hg up null -q
636 588 $ hg log -T '{rev}: {phase}\n'
637 589 2: draft
638 590 1: draft
639 591 0: draft
640 592 $ hg serve -p $HGPORT -d --pid-file=hg.pid
641 593 $ cat hg.pid > $DAEMON_PIDS
642 594 $ cd ..
643 595
644 596 $ hg clone -U --stream http://localhost:$HGPORT with-obsolescence
645 597 streaming all changes
646 598 1098 entries to transfer
647 599 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
648 600 transferred 99.5 KB in * seconds (* */sec) (glob) (zstd no-rust !)
649 601 transferred 99.6 KB in * seconds (* */sec) (glob) (zstd rust !)
650 602 $ hg -R with-obsolescence log -T '{rev}: {phase}\n'
651 603 2: draft
652 604 1: draft
653 605 0: draft
654 606 $ hg debugobsolete -R with-obsolescence
655 607 8c206a663911c1f97f2f9d7382e417ae55872cfa 0 {5223b5e3265f0df40bb743da62249413d74ac70f} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
656 608 $ hg verify -R with-obsolescence -q
657 609
658 610 $ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution
659 611 streaming all changes
660 612 remote: abort: server has obsolescence markers, but client cannot receive them via stream clone
661 613 abort: pull failed on remote
662 614 [100]
663 615
664 616 $ killdaemons.py
665 617
666 618 #endif
667 619
668 620 Cloning a repo with no requirements doesn't give some obscure error
669 621 -------------------------------------------------------------------
670 622
671 623 $ mkdir -p empty-repo/.hg
672 624 $ hg clone -q --stream ssh://user@dummy/empty-repo empty-repo2
673 625 $ hg --cwd empty-repo2 verify -q
674 626
675 627 Cloning a repo with an empty manifestlog doesn't give some weird error
676 628 ----------------------------------------------------------------------
677 629
678 630 $ rm -r empty-repo; hg init empty-repo
679 631 $ (cd empty-repo; touch x; hg commit -Am empty; hg debugstrip -r 0) > /dev/null
680 632 $ hg clone -q --stream ssh://user@dummy/empty-repo empty-repo3
681 633 $ hg --cwd empty-repo3 verify -q 2>&1 | grep -v warning
682 634 [1]
683 635
684 636 The warnings filtered out here are talking about zero-length 'orphan' data files.
685 637 Those are harmless, so that's fine.
686 638
General Comments 0
You need to be logged in to leave comments. Login now