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