##// END OF EJS Templates
tests: stabilize test-bundle.t on Windows...
Matt Harbison -
r42095:35e29a3a default
parent child Browse files
Show More
@@ -1,932 +1,933 b''
1 1 Setting up test
2 2
3 3 $ hg init test
4 4 $ cd test
5 5 $ echo 0 > afile
6 6 $ hg add afile
7 7 $ hg commit -m "0.0"
8 8 $ echo 1 >> afile
9 9 $ hg commit -m "0.1"
10 10 $ echo 2 >> afile
11 11 $ hg commit -m "0.2"
12 12 $ echo 3 >> afile
13 13 $ hg commit -m "0.3"
14 14 $ hg update -C 0
15 15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
16 16 $ echo 1 >> afile
17 17 $ hg commit -m "1.1"
18 18 created new head
19 19 $ echo 2 >> afile
20 20 $ hg commit -m "1.2"
21 21 $ echo "a line" > fred
22 22 $ echo 3 >> afile
23 23 $ hg add fred
24 24 $ hg commit -m "1.3"
25 25 $ hg mv afile adifferentfile
26 26 $ hg commit -m "1.3m"
27 27 $ hg update -C 3
28 28 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
29 29 $ hg mv afile anotherfile
30 30 $ hg commit -m "0.3m"
31 31 $ hg verify
32 32 checking changesets
33 33 checking manifests
34 34 crosschecking files in changesets and manifests
35 35 checking files
36 36 checked 9 changesets with 7 changes to 4 files
37 37 $ cd ..
38 38 $ hg init empty
39 39
40 40 Bundle and phase
41 41
42 42 $ hg -R test phase --force --secret 0
43 43 $ hg -R test bundle phase.hg empty
44 44 searching for changes
45 45 no changes found (ignored 9 secret changesets)
46 46 [1]
47 47 $ hg -R test phase --draft -r 'head()'
48 48
49 49 Bundle --all
50 50
51 51 $ hg -R test bundle --all all.hg
52 52 9 changesets found
53 53
54 54 Bundle test to full.hg
55 55
56 56 $ hg -R test bundle full.hg empty
57 57 searching for changes
58 58 9 changesets found
59 59
60 60 Unbundle full.hg in test
61 61
62 62 $ hg -R test unbundle full.hg
63 63 adding changesets
64 64 adding manifests
65 65 adding file changes
66 66 added 0 changesets with 0 changes to 4 files
67 67 (run 'hg update' to get a working copy)
68 68
69 69 Verify empty
70 70
71 71 $ hg -R empty heads
72 72 [1]
73 73 $ hg -R empty verify
74 74 checking changesets
75 75 checking manifests
76 76 crosschecking files in changesets and manifests
77 77 checking files
78 78 checked 0 changesets with 0 changes to 0 files
79 79
80 80 #if repobundlerepo
81 81
82 82 Pull full.hg into test (using --cwd)
83 83
84 84 $ hg --cwd test pull ../full.hg
85 85 pulling from ../full.hg
86 86 searching for changes
87 87 no changes found
88 88
89 89 Verify that there are no leaked temporary files after pull (issue2797)
90 90
91 91 $ ls test/.hg | grep .hg10un
92 92 [1]
93 93
94 94 Pull full.hg into empty (using --cwd)
95 95
96 96 $ hg --cwd empty pull ../full.hg
97 97 pulling from ../full.hg
98 98 requesting all changes
99 99 adding changesets
100 100 adding manifests
101 101 adding file changes
102 102 added 9 changesets with 7 changes to 4 files (+1 heads)
103 103 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
104 104 (run 'hg heads' to see heads, 'hg merge' to merge)
105 105
106 106 Rollback empty
107 107
108 108 $ hg -R empty rollback
109 109 repository tip rolled back to revision -1 (undo pull)
110 110
111 111 Pull full.hg into empty again (using --cwd)
112 112
113 113 $ hg --cwd empty pull ../full.hg
114 114 pulling from ../full.hg
115 115 requesting all changes
116 116 adding changesets
117 117 adding manifests
118 118 adding file changes
119 119 added 9 changesets with 7 changes to 4 files (+1 heads)
120 120 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
121 121 (run 'hg heads' to see heads, 'hg merge' to merge)
122 122
123 123 Pull full.hg into test (using -R)
124 124
125 125 $ hg -R test pull full.hg
126 126 pulling from full.hg
127 127 searching for changes
128 128 no changes found
129 129
130 130 Pull full.hg into empty (using -R)
131 131
132 132 $ hg -R empty pull full.hg
133 133 pulling from full.hg
134 134 searching for changes
135 135 no changes found
136 136
137 137 Rollback empty
138 138
139 139 $ hg -R empty rollback
140 140 repository tip rolled back to revision -1 (undo pull)
141 141
142 142 Pull full.hg into empty again (using -R)
143 143
144 144 $ hg -R empty pull full.hg
145 145 pulling from full.hg
146 146 requesting all changes
147 147 adding changesets
148 148 adding manifests
149 149 adding file changes
150 150 added 9 changesets with 7 changes to 4 files (+1 heads)
151 151 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
152 152 (run 'hg heads' to see heads, 'hg merge' to merge)
153 153
154 154 Log -R full.hg in fresh empty
155 155
156 156 $ rm -r empty
157 157 $ hg init empty
158 158 $ cd empty
159 159 $ hg -R bundle://../full.hg log
160 160 changeset: 8:aa35859c02ea
161 161 tag: tip
162 162 parent: 3:eebf5a27f8ca
163 163 user: test
164 164 date: Thu Jan 01 00:00:00 1970 +0000
165 165 summary: 0.3m
166 166
167 167 changeset: 7:a6a34bfa0076
168 168 user: test
169 169 date: Thu Jan 01 00:00:00 1970 +0000
170 170 summary: 1.3m
171 171
172 172 changeset: 6:7373c1169842
173 173 user: test
174 174 date: Thu Jan 01 00:00:00 1970 +0000
175 175 summary: 1.3
176 176
177 177 changeset: 5:1bb50a9436a7
178 178 user: test
179 179 date: Thu Jan 01 00:00:00 1970 +0000
180 180 summary: 1.2
181 181
182 182 changeset: 4:095197eb4973
183 183 parent: 0:f9ee2f85a263
184 184 user: test
185 185 date: Thu Jan 01 00:00:00 1970 +0000
186 186 summary: 1.1
187 187
188 188 changeset: 3:eebf5a27f8ca
189 189 user: test
190 190 date: Thu Jan 01 00:00:00 1970 +0000
191 191 summary: 0.3
192 192
193 193 changeset: 2:e38ba6f5b7e0
194 194 user: test
195 195 date: Thu Jan 01 00:00:00 1970 +0000
196 196 summary: 0.2
197 197
198 198 changeset: 1:34c2bf6b0626
199 199 user: test
200 200 date: Thu Jan 01 00:00:00 1970 +0000
201 201 summary: 0.1
202 202
203 203 changeset: 0:f9ee2f85a263
204 204 user: test
205 205 date: Thu Jan 01 00:00:00 1970 +0000
206 206 summary: 0.0
207 207
208 208 Make sure bundlerepo doesn't leak tempfiles (issue2491)
209 209
210 210 $ ls .hg
211 211 00changelog.i
212 212 cache
213 213 requires
214 214 store
215 215 wcache
216 216
217 217 Pull ../full.hg into empty (with hook)
218 218
219 219 $ cat >> .hg/hgrc <<EOF
220 220 > [hooks]
221 221 > changegroup = sh -c "printenv.py --line changegroup"
222 222 > EOF
223 223
224 224 doesn't work (yet ?)
225 225 NOTE: msys is mangling the URL below
226 226
227 227 hg -R bundle://../full.hg verify
228 228
229 229 $ hg pull bundle://../full.hg
230 230 pulling from bundle:../full.hg
231 231 requesting all changes
232 232 adding changesets
233 233 adding manifests
234 234 adding file changes
235 235 added 9 changesets with 7 changes to 4 files (+1 heads)
236 236 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
237 237 changegroup hook: HG_HOOKNAME=changegroup
238 238 HG_HOOKTYPE=changegroup
239 239 HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735
240 240 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf
241 241 HG_SOURCE=pull
242 242 HG_TXNID=TXN:$ID$
243 243 HG_TXNNAME=pull
244 bundle:../full.hg
244 bundle:../full.hg (no-msys !)
245 bundle;../full.hg (msys !)
245 246 HG_URL=bundle:../full.hg (no-msys !)
246 247 HG_URL=bundle;../full.hg (msys !)
247 248
248 249 (run 'hg heads' to see heads, 'hg merge' to merge)
249 250
250 251 Rollback empty
251 252
252 253 $ hg rollback
253 254 repository tip rolled back to revision -1 (undo pull)
254 255 $ cd ..
255 256
256 257 Log -R bundle:empty+full.hg
257 258
258 259 $ hg -R bundle:empty+full.hg log --template="{rev} "; echo ""
259 260 8 7 6 5 4 3 2 1 0
260 261
261 262 Pull full.hg into empty again (using -R; with hook)
262 263
263 264 $ hg -R empty pull full.hg
264 265 pulling from full.hg
265 266 requesting all changes
266 267 adding changesets
267 268 adding manifests
268 269 adding file changes
269 270 added 9 changesets with 7 changes to 4 files (+1 heads)
270 271 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
271 272 changegroup hook: HG_HOOKNAME=changegroup
272 273 HG_HOOKTYPE=changegroup
273 274 HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735
274 275 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf
275 276 HG_SOURCE=pull
276 277 HG_TXNID=TXN:$ID$
277 278 HG_TXNNAME=pull
278 279 bundle:empty+full.hg
279 280 HG_URL=bundle:empty+full.hg
280 281
281 282 (run 'hg heads' to see heads, 'hg merge' to merge)
282 283
283 284 #endif
284 285
285 286 Cannot produce streaming clone bundles with "hg bundle"
286 287
287 288 $ hg -R test bundle -t packed1 packed.hg
288 289 abort: packed bundles cannot be produced by "hg bundle"
289 290 (use 'hg debugcreatestreamclonebundle')
290 291 [255]
291 292
292 293 packed1 is produced properly
293 294
294 295 #if reporevlogstore
295 296
296 297 $ hg -R test debugcreatestreamclonebundle packed.hg
297 298 writing 2664 bytes for 6 files
298 299 bundle requirements: generaldelta, revlogv1, sparserevlog
299 300
300 301 $ f -B 64 --size --sha1 --hexdump packed.hg
301 302 packed.hg: size=2840, sha1=12bf3eee3eb8a04c503ce2d29b48f0135c7edff5
302 303 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 06 00 00 |HGS1UN..........|
303 304 0010: 00 00 00 00 0a 68 00 23 67 65 6e 65 72 61 6c 64 |.....h.#generald|
304 305 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 76 31 2c 73 70 |elta,revlogv1,sp|
305 306 0030: 61 72 73 65 72 65 76 6c 6f 67 00 64 61 74 61 2f |arserevlog.data/|
306 307
307 308 $ hg debugbundle --spec packed.hg
308 309 none-packed1;requirements%3Dgeneraldelta%2Crevlogv1%2Csparserevlog
309 310
310 311 generaldelta requirement is not listed in stream clone bundles unless used
311 312
312 313 $ hg --config format.usegeneraldelta=false init testnongd
313 314 $ cd testnongd
314 315 $ touch foo
315 316 $ hg -q commit -A -m initial
316 317 $ cd ..
317 318 $ hg -R testnongd debugcreatestreamclonebundle packednongd.hg
318 319 writing 301 bytes for 3 files
319 320 bundle requirements: revlogv1
320 321
321 322 $ f -B 64 --size --sha1 --hexdump packednongd.hg
322 323 packednongd.hg: size=383, sha1=1d9c230238edd5d38907100b729ba72b1831fe6f
323 324 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 03 00 00 |HGS1UN..........|
324 325 0010: 00 00 00 00 01 2d 00 09 72 65 76 6c 6f 67 76 31 |.....-..revlogv1|
325 326 0020: 00 64 61 74 61 2f 66 6f 6f 2e 69 00 36 34 0a 00 |.data/foo.i.64..|
326 327 0030: 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
327 328
328 329 $ hg debugbundle --spec packednongd.hg
329 330 none-packed1;requirements%3Drevlogv1
330 331
331 332 Warning emitted when packed bundles contain secret changesets
332 333
333 334 $ hg init testsecret
334 335 $ cd testsecret
335 336 $ touch foo
336 337 $ hg -q commit -A -m initial
337 338 $ hg phase --force --secret -r .
338 339 $ cd ..
339 340
340 341 $ hg -R testsecret debugcreatestreamclonebundle packedsecret.hg
341 342 (warning: stream clone bundle will contain secret revisions)
342 343 writing 301 bytes for 3 files
343 344 bundle requirements: generaldelta, revlogv1, sparserevlog
344 345
345 346 Unpacking packed1 bundles with "hg unbundle" isn't allowed
346 347
347 348 $ hg init packed
348 349 $ hg -R packed unbundle packed.hg
349 350 abort: packed bundles cannot be applied with "hg unbundle"
350 351 (use "hg debugapplystreamclonebundle")
351 352 [255]
352 353
353 354 packed1 can be consumed from debug command
354 355
355 356 (this also confirms that streamclone-ed changes are visible via
356 357 @filecache properties to in-process procedures before closing
357 358 transaction)
358 359
359 360 $ cat > $TESTTMP/showtip.py <<EOF
360 361 > from __future__ import absolute_import
361 362 >
362 363 > def showtip(ui, repo, hooktype, **kwargs):
363 364 > ui.warn(b'%s: %s\n' % (hooktype, repo[b'tip'].hex()[:12]))
364 365 >
365 366 > def reposetup(ui, repo):
366 367 > # this confirms (and ensures) that (empty) 00changelog.i
367 368 > # before streamclone is already cached as repo.changelog
368 369 > ui.setconfig(b'hooks', b'pretxnopen.showtip', showtip)
369 370 >
370 371 > # this confirms that streamclone-ed changes are visible to
371 372 > # in-process procedures before closing transaction
372 373 > ui.setconfig(b'hooks', b'pretxnclose.showtip', showtip)
373 374 >
374 375 > # this confirms that streamclone-ed changes are still visible
375 376 > # after closing transaction
376 377 > ui.setconfig(b'hooks', b'txnclose.showtip', showtip)
377 378 > EOF
378 379 $ cat >> $HGRCPATH <<EOF
379 380 > [extensions]
380 381 > showtip = $TESTTMP/showtip.py
381 382 > EOF
382 383
383 384 $ hg -R packed debugapplystreamclonebundle packed.hg
384 385 6 files to transfer, 2.60 KB of data
385 386 pretxnopen: 000000000000
386 387 pretxnclose: aa35859c02ea
387 388 transferred 2.60 KB in *.* seconds (* */sec) (glob)
388 389 txnclose: aa35859c02ea
389 390
390 391 (for safety, confirm visibility of streamclone-ed changes by another
391 392 process, too)
392 393
393 394 $ hg -R packed tip -T "{node|short}\n"
394 395 aa35859c02ea
395 396
396 397 $ cat >> $HGRCPATH <<EOF
397 398 > [extensions]
398 399 > showtip = !
399 400 > EOF
400 401
401 402 Does not work on non-empty repo
402 403
403 404 $ hg -R packed debugapplystreamclonebundle packed.hg
404 405 abort: cannot apply stream clone bundle on non-empty repo
405 406 [255]
406 407
407 408 #endif
408 409
409 410 Create partial clones
410 411
411 412 $ rm -r empty
412 413 $ hg init empty
413 414 $ hg clone -r 3 test partial
414 415 adding changesets
415 416 adding manifests
416 417 adding file changes
417 418 added 4 changesets with 4 changes to 1 files
418 419 new changesets f9ee2f85a263:eebf5a27f8ca
419 420 updating to branch default
420 421 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
421 422 $ hg clone partial partial2
422 423 updating to branch default
423 424 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
424 425 $ cd partial
425 426
426 427 #if repobundlerepo
427 428
428 429 Log -R full.hg in partial
429 430
430 431 $ hg -R bundle://../full.hg log -T phases
431 432 changeset: 8:aa35859c02ea
432 433 tag: tip
433 434 phase: draft
434 435 parent: 3:eebf5a27f8ca
435 436 user: test
436 437 date: Thu Jan 01 00:00:00 1970 +0000
437 438 summary: 0.3m
438 439
439 440 changeset: 7:a6a34bfa0076
440 441 phase: draft
441 442 user: test
442 443 date: Thu Jan 01 00:00:00 1970 +0000
443 444 summary: 1.3m
444 445
445 446 changeset: 6:7373c1169842
446 447 phase: draft
447 448 user: test
448 449 date: Thu Jan 01 00:00:00 1970 +0000
449 450 summary: 1.3
450 451
451 452 changeset: 5:1bb50a9436a7
452 453 phase: draft
453 454 user: test
454 455 date: Thu Jan 01 00:00:00 1970 +0000
455 456 summary: 1.2
456 457
457 458 changeset: 4:095197eb4973
458 459 phase: draft
459 460 parent: 0:f9ee2f85a263
460 461 user: test
461 462 date: Thu Jan 01 00:00:00 1970 +0000
462 463 summary: 1.1
463 464
464 465 changeset: 3:eebf5a27f8ca
465 466 phase: public
466 467 user: test
467 468 date: Thu Jan 01 00:00:00 1970 +0000
468 469 summary: 0.3
469 470
470 471 changeset: 2:e38ba6f5b7e0
471 472 phase: public
472 473 user: test
473 474 date: Thu Jan 01 00:00:00 1970 +0000
474 475 summary: 0.2
475 476
476 477 changeset: 1:34c2bf6b0626
477 478 phase: public
478 479 user: test
479 480 date: Thu Jan 01 00:00:00 1970 +0000
480 481 summary: 0.1
481 482
482 483 changeset: 0:f9ee2f85a263
483 484 phase: public
484 485 user: test
485 486 date: Thu Jan 01 00:00:00 1970 +0000
486 487 summary: 0.0
487 488
488 489
489 490 Incoming full.hg in partial
490 491
491 492 $ hg incoming bundle://../full.hg
492 493 comparing with bundle:../full.hg
493 494 searching for changes
494 495 changeset: 4:095197eb4973
495 496 parent: 0:f9ee2f85a263
496 497 user: test
497 498 date: Thu Jan 01 00:00:00 1970 +0000
498 499 summary: 1.1
499 500
500 501 changeset: 5:1bb50a9436a7
501 502 user: test
502 503 date: Thu Jan 01 00:00:00 1970 +0000
503 504 summary: 1.2
504 505
505 506 changeset: 6:7373c1169842
506 507 user: test
507 508 date: Thu Jan 01 00:00:00 1970 +0000
508 509 summary: 1.3
509 510
510 511 changeset: 7:a6a34bfa0076
511 512 user: test
512 513 date: Thu Jan 01 00:00:00 1970 +0000
513 514 summary: 1.3m
514 515
515 516 changeset: 8:aa35859c02ea
516 517 tag: tip
517 518 parent: 3:eebf5a27f8ca
518 519 user: test
519 520 date: Thu Jan 01 00:00:00 1970 +0000
520 521 summary: 0.3m
521 522
522 523
523 524 Outgoing -R full.hg vs partial2 in partial
524 525
525 526 $ hg -R bundle://../full.hg outgoing ../partial2
526 527 comparing with ../partial2
527 528 searching for changes
528 529 changeset: 4:095197eb4973
529 530 parent: 0:f9ee2f85a263
530 531 user: test
531 532 date: Thu Jan 01 00:00:00 1970 +0000
532 533 summary: 1.1
533 534
534 535 changeset: 5:1bb50a9436a7
535 536 user: test
536 537 date: Thu Jan 01 00:00:00 1970 +0000
537 538 summary: 1.2
538 539
539 540 changeset: 6:7373c1169842
540 541 user: test
541 542 date: Thu Jan 01 00:00:00 1970 +0000
542 543 summary: 1.3
543 544
544 545 changeset: 7:a6a34bfa0076
545 546 user: test
546 547 date: Thu Jan 01 00:00:00 1970 +0000
547 548 summary: 1.3m
548 549
549 550 changeset: 8:aa35859c02ea
550 551 tag: tip
551 552 parent: 3:eebf5a27f8ca
552 553 user: test
553 554 date: Thu Jan 01 00:00:00 1970 +0000
554 555 summary: 0.3m
555 556
556 557
557 558 Outgoing -R does-not-exist.hg vs partial2 in partial
558 559
559 560 $ hg -R bundle://../does-not-exist.hg outgoing ../partial2
560 561 abort: *../does-not-exist.hg* (glob)
561 562 [255]
562 563
563 564 #endif
564 565
565 566 $ cd ..
566 567
567 568 hide outer repo
568 569 $ hg init
569 570
570 571 Direct clone from bundle (all-history)
571 572
572 573 #if repobundlerepo
573 574
574 575 $ hg clone full.hg full-clone
575 576 requesting all changes
576 577 adding changesets
577 578 adding manifests
578 579 adding file changes
579 580 added 9 changesets with 7 changes to 4 files (+1 heads)
580 581 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
581 582 updating to branch default
582 583 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
583 584 $ hg -R full-clone heads
584 585 changeset: 8:aa35859c02ea
585 586 tag: tip
586 587 parent: 3:eebf5a27f8ca
587 588 user: test
588 589 date: Thu Jan 01 00:00:00 1970 +0000
589 590 summary: 0.3m
590 591
591 592 changeset: 7:a6a34bfa0076
592 593 user: test
593 594 date: Thu Jan 01 00:00:00 1970 +0000
594 595 summary: 1.3m
595 596
596 597 $ rm -r full-clone
597 598
598 599 When cloning from a non-copiable repository into '', do not
599 600 recurse infinitely (issue2528)
600 601
601 602 $ hg clone full.hg ''
602 603 abort: empty destination path is not valid
603 604 [255]
604 605
605 606 test for https://bz.mercurial-scm.org/216
606 607
607 608 Unbundle incremental bundles into fresh empty in one go
608 609
609 610 $ rm -r empty
610 611 $ hg init empty
611 612 $ hg -R test bundle --base null -r 0 ../0.hg
612 613 1 changesets found
613 614 $ hg -R test bundle --base 0 -r 1 ../1.hg
614 615 1 changesets found
615 616 $ hg -R empty unbundle -u ../0.hg ../1.hg
616 617 adding changesets
617 618 adding manifests
618 619 adding file changes
619 620 added 1 changesets with 1 changes to 1 files
620 621 new changesets f9ee2f85a263 (1 drafts)
621 622 adding changesets
622 623 adding manifests
623 624 adding file changes
624 625 added 1 changesets with 1 changes to 1 files
625 626 new changesets 34c2bf6b0626 (1 drafts)
626 627 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
627 628
628 629 View full contents of the bundle
629 630 $ hg -R test bundle --base null -r 3 ../partial.hg
630 631 4 changesets found
631 632 $ cd test
632 633 $ hg -R ../../partial.hg log -r "bundle()"
633 634 changeset: 0:f9ee2f85a263
634 635 user: test
635 636 date: Thu Jan 01 00:00:00 1970 +0000
636 637 summary: 0.0
637 638
638 639 changeset: 1:34c2bf6b0626
639 640 user: test
640 641 date: Thu Jan 01 00:00:00 1970 +0000
641 642 summary: 0.1
642 643
643 644 changeset: 2:e38ba6f5b7e0
644 645 user: test
645 646 date: Thu Jan 01 00:00:00 1970 +0000
646 647 summary: 0.2
647 648
648 649 changeset: 3:eebf5a27f8ca
649 650 user: test
650 651 date: Thu Jan 01 00:00:00 1970 +0000
651 652 summary: 0.3
652 653
653 654 $ cd ..
654 655
655 656 #endif
656 657
657 658 test for 540d1059c802
658 659
659 660 $ hg init orig
660 661 $ cd orig
661 662 $ echo foo > foo
662 663 $ hg add foo
663 664 $ hg ci -m 'add foo'
664 665
665 666 $ hg clone . ../copy
666 667 updating to branch default
667 668 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
668 669 $ hg tag foo
669 670
670 671 $ cd ../copy
671 672 $ echo >> foo
672 673 $ hg ci -m 'change foo'
673 674 $ hg bundle ../bundle.hg ../orig
674 675 searching for changes
675 676 1 changesets found
676 677
677 678 $ cd ..
678 679
679 680 #if repobundlerepo
680 681 $ cd orig
681 682 $ hg incoming ../bundle.hg
682 683 comparing with ../bundle.hg
683 684 searching for changes
684 685 changeset: 2:ed1b79f46b9a
685 686 tag: tip
686 687 parent: 0:bbd179dfa0a7
687 688 user: test
688 689 date: Thu Jan 01 00:00:00 1970 +0000
689 690 summary: change foo
690 691
691 692 $ cd ..
692 693
693 694 test bundle with # in the filename (issue2154):
694 695
695 696 $ cp bundle.hg 'test#bundle.hg'
696 697 $ cd orig
697 698 $ hg incoming '../test#bundle.hg'
698 699 comparing with ../test
699 700 abort: unknown revision 'bundle.hg'!
700 701 [255]
701 702
702 703 note that percent encoding is not handled:
703 704
704 705 $ hg incoming ../test%23bundle.hg
705 706 abort: repository ../test%23bundle.hg not found!
706 707 [255]
707 708 $ cd ..
708 709
709 710 #endif
710 711
711 712 test to bundle revisions on the newly created branch (issue3828):
712 713
713 714 $ hg -q clone -U test test-clone
714 715 $ cd test
715 716
716 717 $ hg -q branch foo
717 718 $ hg commit -m "create foo branch"
718 719 $ hg -q outgoing ../test-clone
719 720 9:b4f5acb1ee27
720 721 $ hg -q bundle --branch foo foo.hg ../test-clone
721 722 #if repobundlerepo
722 723 $ hg -R foo.hg -q log -r "bundle()"
723 724 9:b4f5acb1ee27
724 725 #endif
725 726
726 727 $ cd ..
727 728
728 729 test for https://bz.mercurial-scm.org/1144
729 730
730 731 test that verify bundle does not traceback
731 732
732 733 partial history bundle, fails w/ unknown parent
733 734
734 735 $ hg -R bundle.hg verify
735 736 abort: 00changelog.i@bbd179dfa0a7: unknown parent!
736 737 [255]
737 738
738 739 full history bundle, refuses to verify non-local repo
739 740
740 741 #if repobundlerepo
741 742 $ hg -R all.hg verify
742 743 abort: cannot verify bundle or remote repos
743 744 [255]
744 745 #endif
745 746
746 747 but, regular verify must continue to work
747 748
748 749 $ hg -R orig verify
749 750 checking changesets
750 751 checking manifests
751 752 crosschecking files in changesets and manifests
752 753 checking files
753 754 checked 2 changesets with 2 changes to 2 files
754 755
755 756 #if repobundlerepo
756 757 diff against bundle
757 758
758 759 $ hg init b
759 760 $ cd b
760 761 $ hg -R ../all.hg diff -r tip
761 762 diff -r aa35859c02ea anotherfile
762 763 --- a/anotherfile Thu Jan 01 00:00:00 1970 +0000
763 764 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
764 765 @@ -1,4 +0,0 @@
765 766 -0
766 767 -1
767 768 -2
768 769 -3
769 770 $ cd ..
770 771 #endif
771 772
772 773 bundle single branch
773 774
774 775 $ hg init branchy
775 776 $ cd branchy
776 777 $ echo a >a
777 778 $ echo x >x
778 779 $ hg ci -Ama
779 780 adding a
780 781 adding x
781 782 $ echo c >c
782 783 $ echo xx >x
783 784 $ hg ci -Amc
784 785 adding c
785 786 $ echo c1 >c1
786 787 $ hg ci -Amc1
787 788 adding c1
788 789 $ hg up 0
789 790 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
790 791 $ echo b >b
791 792 $ hg ci -Amb
792 793 adding b
793 794 created new head
794 795 $ echo b1 >b1
795 796 $ echo xx >x
796 797 $ hg ci -Amb1
797 798 adding b1
798 799 $ hg clone -q -r2 . part
799 800
800 801 == bundling via incoming
801 802
802 803 $ hg in -R part --bundle incoming.hg --template "{node}\n" .
803 804 comparing with .
804 805 searching for changes
805 806 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a
806 807 057f4db07f61970e1c11e83be79e9d08adc4dc31
807 808
808 809 == bundling
809 810
810 811 $ hg bundle bundle.hg part --debug --config progress.debug=true
811 812 query 1; heads
812 813 searching for changes
813 814 all remote heads known locally
814 815 2 changesets found
815 816 list of changesets:
816 817 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a
817 818 057f4db07f61970e1c11e83be79e9d08adc4dc31
818 819 bundle2-output-bundle: "HG20", (1 params) 2 parts total
819 820 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
820 821 changesets: 1/2 chunks (50.00%)
821 822 changesets: 2/2 chunks (100.00%)
822 823 manifests: 1/2 chunks (50.00%)
823 824 manifests: 2/2 chunks (100.00%)
824 825 files: b 1/3 files (33.33%)
825 826 files: b1 2/3 files (66.67%)
826 827 files: x 3/3 files (100.00%)
827 828 bundle2-output-part: "cache:rev-branch-cache" (advisory) streamed payload
828 829
829 830 #if repobundlerepo
830 831 == Test for issue3441
831 832
832 833 $ hg clone -q -r0 . part2
833 834 $ hg -q -R part2 pull bundle.hg
834 835 $ hg -R part2 verify
835 836 checking changesets
836 837 checking manifests
837 838 crosschecking files in changesets and manifests
838 839 checking files
839 840 checked 3 changesets with 5 changes to 4 files
840 841 #endif
841 842
842 843 == Test bundling no commits
843 844
844 845 $ hg bundle -r 'public()' no-output.hg
845 846 abort: no commits to bundle
846 847 [255]
847 848
848 849 $ cd ..
849 850
850 851 When user merges to the revision existing only in the bundle,
851 852 it should show warning that second parent of the working
852 853 directory does not exist
853 854
854 855 $ hg init update2bundled
855 856 $ cd update2bundled
856 857 $ cat <<EOF >> .hg/hgrc
857 858 > [extensions]
858 859 > strip =
859 860 > EOF
860 861 $ echo "aaa" >> a
861 862 $ hg commit -A -m 0
862 863 adding a
863 864 $ echo "bbb" >> b
864 865 $ hg commit -A -m 1
865 866 adding b
866 867 $ echo "ccc" >> c
867 868 $ hg commit -A -m 2
868 869 adding c
869 870 $ hg update -r 1
870 871 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
871 872 $ echo "ddd" >> d
872 873 $ hg commit -A -m 3
873 874 adding d
874 875 created new head
875 876 $ hg update -r 2
876 877 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
877 878 $ hg log -G
878 879 o changeset: 3:8bd3e1f196af
879 880 | tag: tip
880 881 | parent: 1:a01eca7af26d
881 882 | user: test
882 883 | date: Thu Jan 01 00:00:00 1970 +0000
883 884 | summary: 3
884 885 |
885 886 | @ changeset: 2:4652c276ac4f
886 887 |/ user: test
887 888 | date: Thu Jan 01 00:00:00 1970 +0000
888 889 | summary: 2
889 890 |
890 891 o changeset: 1:a01eca7af26d
891 892 | user: test
892 893 | date: Thu Jan 01 00:00:00 1970 +0000
893 894 | summary: 1
894 895 |
895 896 o changeset: 0:4fe08cd4693e
896 897 user: test
897 898 date: Thu Jan 01 00:00:00 1970 +0000
898 899 summary: 0
899 900
900 901
901 902 #if repobundlerepo
902 903 $ hg bundle --base 1 -r 3 ../update2bundled.hg
903 904 1 changesets found
904 905 $ hg strip -r 3
905 906 saved backup bundle to $TESTTMP/update2bundled/.hg/strip-backup/8bd3e1f196af-017e56d8-backup.hg
906 907 $ hg merge -R ../update2bundled.hg -r 3
907 908 setting parent to node 8bd3e1f196af289b2b121be08031e76d7ae92098 that only exists in the bundle
908 909 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
909 910 (branch merge, don't forget to commit)
910 911
911 912 When user updates to the revision existing only in the bundle,
912 913 it should show warning
913 914
914 915 $ hg update -R ../update2bundled.hg --clean -r 3
915 916 setting parent to node 8bd3e1f196af289b2b121be08031e76d7ae92098 that only exists in the bundle
916 917 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
917 918
918 919 When user updates to the revision existing in the local repository
919 920 the warning shouldn't be emitted
920 921
921 922 $ hg update -R ../update2bundled.hg -r 0
922 923 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
923 924 #endif
924 925
925 926 Test the option that create slim bundle
926 927
927 928 $ hg bundle -a --config devel.bundle.delta=p1 ./slim.hg
928 929 3 changesets found
929 930
930 931 Test the option that create and no-delta's bundle
931 932 $ hg bundle -a --config devel.bundle.delta=full ./full.hg
932 933 3 changesets found
General Comments 0
You need to be logged in to leave comments. Login now