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