comparison tests/test-sharing.t @ 1265:14f91037d2f6 stable

docs: revive the explanation of divergent changesets in the sharing guide
author Greg Ward <greg@gerg.ca>
date Tue, 14 Apr 2015 12:58:13 -0400
parents eb0a1d1d499b
children aff6bc2a6b2d
comparison
equal deleted inserted replaced
1264:33ed6119a0be 1265:14f91037d2f6
422 | 422 |
423 o 2:540ba8f317e6 public implement feature X (v3) 423 o 2:540ba8f317e6 public implement feature X (v3)
424 | 424 |
425 o 1:de6151c48e1c public fix bug 37 425 o 1:de6151c48e1c public fix bug 37
426 | 426 |
427 $ cd ..
428
429 Setup for "cowboy mode" shared mutable history (to illustrate divergent
430 and bumped changesets).
431 $ rm -rf review alice bob
432 $ hg clone public alice
433 updating to branch default
434 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
435 $ hg clone public bob
436 updating to branch default
437 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
438 $ cat >> alice/.hg/hgrc <<EOF
439 > [phases]
440 > publish = false
441 > EOF
442 $ cp alice/.hg/hgrc bob/.hg/hgrc
443
444 Now we'll have Bob commit a bug fix that could still be improved::
445
446 $ cd bob
447 $ echo 'pretty good fix' >> file1
448 $ hg commit -u bob -m 'fix bug 24 (v1)'
449 $ hg shortlog -r .
450 4:2fe6c4bd32d0 draft fix bug 24 (v1)
451
452 Since Alice and Bob are now in cowboy mode, Alice pulls Bob's draft
453 changeset and amends it herself. ::
454
455 $ cd ../alice
456 $ hg pull -u ../bob
457 pulling from ../bob
458 searching for changes
459 adding changesets
460 adding manifests
461 adding file changes
462 added 1 changesets with 1 changes to 1 files
463 pull obsolescence markers
464 0 obsolescence markers added
465 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
466 $ echo 'better fix (alice)' >> file1
467 $ hg amend -u alice -m 'fix bug 24 (v2 by alice)'
468
469 Bob implements a better fix of his own::
470
471 $ cd ../bob
472 $ echo 'better fix (bob)' >> file1
473 $ hg amend -u bob -m 'fix bug 24 (v2 by bob)'
474 $ hg --hidden shortlog -G -r 3::
475 @ 6:a360947f6faf draft fix bug 24 (v2 by bob)
476 |
477 | x 5:3466c7f5a149 draft temporary amend commit for 2fe6c4bd32d0
478 | |
479 | x 4:2fe6c4bd32d0 draft fix bug 24 (v1)
480 |/
481 o 3:a06ec1bf97bd public fix bug 15 (v2)
482 |
483
484 Bob discovers the divergence.
485 $ hg pull ../alice
486 pulling from ../alice
487 searching for changes
488 adding changesets
489 adding manifests
490 adding file changes
491 added 1 changesets with 1 changes to 1 files (+1 heads)
492 pull obsolescence markers
493 2 obsolescence markers added
494 (run 'hg heads' to see heads, 'hg merge' to merge)
495 2 new divergent changesets
496
497 Figure SG09: multiple heads! divergence! oh my!
498 $ hg --hidden shortlog -G -r 3::
499 o 7:e3f99ce9d9cd draft fix bug 24 (v2 by alice)
500 |
501 | @ 6:a360947f6faf draft fix bug 24 (v2 by bob)
502 |/
503 | x 5:3466c7f5a149 draft temporary amend commit for 2fe6c4bd32d0
504 | |
505 | x 4:2fe6c4bd32d0 draft fix bug 24 (v1)
506 |/
507 o 3:a06ec1bf97bd public fix bug 15 (v2)
508 |
509 $ hg --hidden shortlog -r 'successors(2fe6)'
510 6:a360947f6faf draft fix bug 24 (v2 by bob)
511 7:e3f99ce9d9cd draft fix bug 24 (v2 by alice)
512
513 Use evolve to fix the divergence.
514 $ HGMERGE=internal:other hg evolve
515 merge:[6] fix bug 24 (v2 by bob)
516 with: [7] fix bug 24 (v2 by alice)
517 base: [4] fix bug 24 (v1)
518 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
519 working directory is now at 5ad6037c046c
520 $ hg log -q -r 'divergent()'
521
522 Figure SG10: Bob's repository after fixing divergence.
523 $ hg --hidden shortlog -G -r 3::
524 @ 9:5ad6037c046c draft fix bug 24 (v2 by bob)
525 |
526 | x 8:bcfc9a755ac3 draft temporary amend commit for a360947f6faf
527 | |
528 +---x 7:e3f99ce9d9cd draft fix bug 24 (v2 by alice)
529 | |
530 | x 6:a360947f6faf draft fix bug 24 (v2 by bob)
531 |/
532 | x 5:3466c7f5a149 draft temporary amend commit for 2fe6c4bd32d0
533 | |
534 | x 4:2fe6c4bd32d0 draft fix bug 24 (v1)
535 |/
536 o 3:a06ec1bf97bd public fix bug 15 (v2)
537 |
538 $ hg --hidden shortlog -r 'precursors(9)'
539 6:a360947f6faf draft fix bug 24 (v2 by bob)
540 7:e3f99ce9d9cd draft fix bug 24 (v2 by alice)
541 $ cat file1
542 Do stuff.
543 pretty good fix
544 better fix (alice)