comparison tests/test-tutorial.t @ 638:8fd7ac58b762 stable

tutorial: use rebase instead of graft -O
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Wed, 02 Jan 2013 12:37:25 +0100
parents fdbbc9b2fca2
children bc2527223350
comparison
equal deleted inserted replaced
637:fdbbc9b2fca2 638:8fd7ac58b762
337 337
338 You can use 'rebase -r' or 'graft -O' for that: 338 You can use 'rebase -r' or 'graft -O' for that:
339 339
340 $ hg up 'p1(8d39a843582d)' # going on "bathroom stuff" parent 340 $ hg up 'p1(8d39a843582d)' # going on "bathroom stuff" parent
341 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 341 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
342 $ hg graft -O c48f32fb1787 # moving "SPAM SPAM" to the working directory parent 342 $ hg rebase --rev c48f32fb1787 --dest . # moving "SPAM SPAM" to the working directory parent
343 grafting revision 10
344 merging shopping 343 merging shopping
345 $ hg log -G 344 $ hg log -G
346 @ a2fccc2e7b08 (draft): SPAM SPAM 345 @ 02e33960e937 (draft): SPAM SPAM
347 | 346 |
348 | o 8d39a843582d (draft): bathroom stuff 347 | o 8d39a843582d (draft): bathroom stuff
349 |/ 348 |/
350 o 387187ad9bd9 (draft): adding fruit 349 o 387187ad9bd9 (draft): adding fruit
351 | 350 |
364 [1] 363 [1]
365 $ hg export . 364 $ hg export .
366 # HG changeset patch 365 # HG changeset patch
367 # User test 366 # User test
368 # Date 0 0 367 # Date 0 0
369 # Node ID a2fccc2e7b08bbce6af7255b989453f7089e4cf0 368 # Node ID 02e33960e937ad1bd59241ebdafd7a2494240ddf
370 # Parent 387187ad9bd9d8f9a00a9fa804a26231db547429 369 # Parent 387187ad9bd9d8f9a00a9fa804a26231db547429
371 SPAM SPAM 370 SPAM SPAM
372 371
373 diff --git a/shopping b/shopping 372 diff --git a/shopping b/shopping
374 --- a/shopping 373 --- a/shopping
395 adding file changes 394 adding file changes
396 added 3 changesets with 3 changes to 1 files 395 added 3 changesets with 3 changes to 1 files
397 396
398 for simplicity shake we get the bathroom change in line again 397 for simplicity shake we get the bathroom change in line again
399 398
400 $ hg rebase -r 8d39a843582d -d a2fccc2e7b08 399 $ hg rebase -r 8d39a843582d -d 02e33960e937
401 merging shopping 400 merging shopping
402 $ hg phase --draft . 401 $ hg phase --draft .
403 $ hg log -G 402 $ hg log -G
404 @ 8a79ae8b029e (draft): bathroom stuff 403 @ a3515e5d0332 (draft): bathroom stuff
405 | 404 |
406 o a2fccc2e7b08 (public): SPAM SPAM 405 o 02e33960e937 (public): SPAM SPAM
407 | 406 |
408 o 387187ad9bd9 (public): adding fruit 407 o 387187ad9bd9 (public): adding fruit
409 | 408 |
410 o dfd3a2d7691e (public): adding condiment 409 o dfd3a2d7691e (public): adding condiment
411 | 410 |
455 adding manifests 454 adding manifests
456 adding file changes 455 adding file changes
457 added 1 changesets with 1 changes to 1 files 456 added 1 changesets with 1 changes to 1 files
458 (run 'hg update' to get a working copy) 457 (run 'hg update' to get a working copy)
459 $ hg log -G 458 $ hg log -G
460 o 8a79ae8b029e (public): bathroom stuff 459 o a3515e5d0332 (public): bathroom stuff
461 | 460 |
462 o a2fccc2e7b08 (public): SPAM SPAM 461 o 02e33960e937 (public): SPAM SPAM
463 | 462 |
464 o 387187ad9bd9 (public): adding fruit 463 o 387187ad9bd9 (public): adding fruit
465 | 464 |
466 o dfd3a2d7691e (public): adding condiment 465 o dfd3a2d7691e (public): adding condiment
467 | 466 |
475 We do not want to publish the "bathroom changeset". Let's rollback the last transaction 474 We do not want to publish the "bathroom changeset". Let's rollback the last transaction
476 475
477 $ hg rollback 476 $ hg rollback
478 repository tip rolled back to revision 4 (undo pull) 477 repository tip rolled back to revision 4 (undo pull)
479 $ hg log -G 478 $ hg log -G
480 o a2fccc2e7b08 (public): SPAM SPAM 479 o 02e33960e937 (public): SPAM SPAM
481 | 480 |
482 o 387187ad9bd9 (public): adding fruit 481 o 387187ad9bd9 (public): adding fruit
483 | 482 |
484 o dfd3a2d7691e (public): adding condiment 483 o dfd3a2d7691e (public): adding condiment
485 | 484 |
509 adding manifests 508 adding manifests
510 adding file changes 509 adding file changes
511 added 1 changesets with 1 changes to 1 files 510 added 1 changesets with 1 changes to 1 files
512 (run 'hg update' to get a working copy) 511 (run 'hg update' to get a working copy)
513 $ hg log -G 512 $ hg log -G
514 o 8a79ae8b029e (draft): bathroom stuff 513 o a3515e5d0332 (draft): bathroom stuff
515 | 514 |
516 o a2fccc2e7b08 (public): SPAM SPAM 515 o 02e33960e937 (public): SPAM SPAM
517 | 516 |
518 o 387187ad9bd9 (public): adding fruit 517 o 387187ad9bd9 (public): adding fruit
519 | 518 |
520 o dfd3a2d7691e (public): adding condiment 519 o dfd3a2d7691e (public): adding condiment
521 | 520 |
527 Rebasing unstable change after pull 526 Rebasing unstable change after pull
528 ---------------------------------------------- 527 ----------------------------------------------
529 528
530 Remotely someone add a new changeset on top of the mutable "bathroom" on. 529 Remotely someone add a new changeset on top of the mutable "bathroom" on.
531 530
532 $ hg up 8a79ae8b029e -q 531 $ hg up a3515e5d0332 -q
533 $ cat >> shopping << EOF 532 $ cat >> shopping << EOF
534 > Giraffe 533 > Giraffe
535 > Rhino 534 > Rhino
536 > Lion 535 > Lion
537 > Bear 536 > Bear
539 $ hg ci -m 'animals' 538 $ hg ci -m 'animals'
540 539
541 But at the same time, locally, this same "bathroom changeset" was updated. 540 But at the same time, locally, this same "bathroom changeset" was updated.
542 541
543 $ cd ../local 542 $ cd ../local
544 $ hg up 8a79ae8b029e -q 543 $ hg up a3515e5d0332 -q
545 $ sed -i'' -e 's/... More bathroom stuff to come/Bath Robe/' shopping 544 $ sed -i'' -e 's/... More bathroom stuff to come/Bath Robe/' shopping
546 $ hg commit --amend 545 $ hg commit --amend
547 $ hg log -G 546 $ hg log -G
548 @ 30aa78f63aa1 (draft): bathroom stuff 547 @ 36b5ba414186 (draft): bathroom stuff
549 | 548 |
550 o a2fccc2e7b08 (public): SPAM SPAM 549 o 02e33960e937 (public): SPAM SPAM
551 | 550 |
552 o 387187ad9bd9 (public): adding fruit 551 o 387187ad9bd9 (public): adding fruit
553 | 552 |
554 o dfd3a2d7691e (public): adding condiment 553 o dfd3a2d7691e (public): adding condiment
555 | 554 |
575 574
576 The new changeset "animal" is based one an old changeset of "bathroom". You can 575 The new changeset "animal" is based one an old changeset of "bathroom". You can
577 see both version showing up in the log. 576 see both version showing up in the log.
578 577
579 $ hg log -G 578 $ hg log -G
580 o 9ac5d0e790a2 (draft): animals 579 o 0b061760b677 (draft): animals
581 | 580 |
582 | @ 30aa78f63aa1 (draft): bathroom stuff 581 | @ 36b5ba414186 (draft): bathroom stuff
583 | | 582 | |
584 x | 8a79ae8b029e (draft): bathroom stuff 583 x | a3515e5d0332 (draft): bathroom stuff
585 |/ 584 |/
586 o a2fccc2e7b08 (public): SPAM SPAM 585 o 02e33960e937 (public): SPAM SPAM
587 | 586 |
588 o 387187ad9bd9 (public): adding fruit 587 o 387187ad9bd9 (public): adding fruit
589 | 588 |
590 o dfd3a2d7691e (public): adding condiment 589 o dfd3a2d7691e (public): adding condiment
591 | 590 |
592 o 9ca060c80d74 (public): SPAM 591 o 9ca060c80d74 (public): SPAM
593 | 592 |
594 o 7e82d3f3c2cb (public): Monthy Python Shopping list 593 o 7e82d3f3c2cb (public): Monthy Python Shopping list
595 594
596 595
597 The older version 8a79ae8b029e never ceased to exist in the local repo. It was 596 The older version a3515e5d0332 never ceased to exist in the local repo. It was
598 jsut hidden and excluded from pull and push. 597 jsut hidden and excluded from pull and push.
599 598
600 .. note:: In hgview there is a nice doted relation highlighting 30aa78f63aa1 as a new version of 8a79ae8b029e. this is not yet ported to graphlog. 599 .. note:: In hgview there is a nice doted relation highlighting 36b5ba414186 as a new version of a3515e5d0332. this is not yet ported to graphlog.
601 600
602 Their is **unstable** changeset in this history now. Mercurial will refuse to 601 Their is **unstable** changeset in this history now. Mercurial will refuse to
603 share it with the outside: 602 share it with the outside:
604 603
605 $ hg push other 604 $ hg push other
606 pushing to $TESTTMP/other 605 pushing to $TESTTMP/other
607 searching for changes 606 searching for changes
608 abort: push includes unstable changeset: 9ac5d0e790a2! 607 abort: push includes unstable changeset: 0b061760b677!
609 (use 'hg evolve' to get a stable history or --force to ignore warnings) 608 (use 'hg evolve' to get a stable history or --force to ignore warnings)
610 [255] 609 [255]
611 610
612 611
613 612
614 613
615 To resolve this unstable state, you need to rebase 9ac5d0e790a2 onto 614 To resolve this unstable state, you need to rebase 0b061760b677 onto
616 30aa78f63aa1 the "hg evolve" command will make this for you. 615 36b5ba414186 the "hg evolve" command will make this for you.
617 616
618 It has a --dry-run option to only suggest the next move. 617 It has a --dry-run option to only suggest the next move.
619 618
620 $ hg evolve --dry-run 619 $ hg evolve --dry-run
621 move:[15] animals 620 move:[15] animals
622 atop:[14] bathroom stuff 621 atop:[14] bathroom stuff
623 hg rebase -r 9ac5d0e790a2 -d 30aa78f63aa1 622 hg rebase -r 0b061760b677 -d 36b5ba414186
624 623
625 Let's do it 624 Let's do it
626 625
627 $ hg rebase -r 9ac5d0e790a2 -d 30aa78f63aa1 626 $ hg rebase -r 0b061760b677 -d 36b5ba414186
628 merging shopping 627 merging shopping
629 628
630 The old version of bathroom is hidden again. 629 The old version of bathroom is hidden again.
631 630
632 $ hg log -G 631 $ hg log -G
633 @ 01fddc75bfef (draft): animals 632 @ fd0d2651e61c (draft): animals
634 | 633 |
635 o 30aa78f63aa1 (draft): bathroom stuff 634 o 36b5ba414186 (draft): bathroom stuff
636 | 635 |
637 o a2fccc2e7b08 (public): SPAM SPAM 636 o 02e33960e937 (public): SPAM SPAM
638 | 637 |
639 o 387187ad9bd9 (public): adding fruit 638 o 387187ad9bd9 (public): adding fruit
640 | 639 |
641 o dfd3a2d7691e (public): adding condiment 640 o dfd3a2d7691e (public): adding condiment
642 | 641 |
663 pulling from $TESTTMP/local 662 pulling from $TESTTMP/local
664 searching for changes 663 searching for changes
665 no changes found 664 no changes found
666 Working directory parent is obsolete 665 Working directory parent is obsolete
667 666
668 $ hg up 01fddc75bfef 667 $ hg up fd0d2651e61c
669 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 668 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
670 669
671 Relocating unstable change after prune 670 Relocating unstable change after prune
672 ---------------------------------------------- 671 ----------------------------------------------
673 672
686 adding manifests 685 adding manifests
687 adding file changes 686 adding file changes
688 added 1 changesets with 1 changes to 1 files 687 added 1 changesets with 1 changes to 1 files
689 (run 'hg update' to get a working copy) 688 (run 'hg update' to get a working copy)
690 $ hg log -G 689 $ hg log -G
691 o cf306eb0d98f (draft): SPAM SPAM SPAM 690 o 56c68f64a3a0 (draft): SPAM SPAM SPAM
692 | 691 |
693 @ 01fddc75bfef (draft): animals 692 @ fd0d2651e61c (draft): animals
694 | 693 |
695 o 30aa78f63aa1 (draft): bathroom stuff 694 o 36b5ba414186 (draft): bathroom stuff
696 | 695 |
697 o a2fccc2e7b08 (public): SPAM SPAM 696 o 02e33960e937 (public): SPAM SPAM
698 | 697 |
699 o 387187ad9bd9 (public): adding fruit 698 o 387187ad9bd9 (public): adding fruit
700 | 699 |
701 o dfd3a2d7691e (public): adding condiment 700 o dfd3a2d7691e (public): adding condiment
702 | 701 |
705 o 7e82d3f3c2cb (public): Monthy Python Shopping list 704 o 7e82d3f3c2cb (public): Monthy Python Shopping list
706 705
707 706
708 In the mean time I noticed you can't buy animals in a super market and I prune the animal changeset: 707 In the mean time I noticed you can't buy animals in a super market and I prune the animal changeset:
709 708
710 $ hg prune 01fddc75bfef 709 $ hg prune fd0d2651e61c
711 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 710 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
712 working directory now at 30aa78f63aa1 711 working directory now at 36b5ba414186
713 1 new unstable changesets 712 1 new unstable changesets
714 713
715 714
716 The animals changeset is still displayed because the "SPAM SPAM SPAM" changeset 715 The animals changeset is still displayed because the "SPAM SPAM SPAM" changeset
717 is neither dead or obsolete. My repository is in an unstable state again. 716 is neither dead or obsolete. My repository is in an unstable state again.
718 717
719 $ hg log -G 718 $ hg log -G
720 o cf306eb0d98f (draft): SPAM SPAM SPAM 719 o 56c68f64a3a0 (draft): SPAM SPAM SPAM
721 | 720 |
722 x 01fddc75bfef (draft): animals 721 x fd0d2651e61c (draft): animals
723 | 722 |
724 @ 30aa78f63aa1 (draft): bathroom stuff 723 @ 36b5ba414186 (draft): bathroom stuff
725 | 724 |
726 o a2fccc2e7b08 (public): SPAM SPAM 725 o 02e33960e937 (public): SPAM SPAM
727 | 726 |
728 o 387187ad9bd9 (public): adding fruit 727 o 387187ad9bd9 (public): adding fruit
729 | 728 |
730 o dfd3a2d7691e (public): adding condiment 729 o dfd3a2d7691e (public): adding condiment
731 | 730 |
733 | 732 |
734 o 7e82d3f3c2cb (public): Monthy Python Shopping list 733 o 7e82d3f3c2cb (public): Monthy Python Shopping list
735 734
736 735
737 $ hg log -r 'unstable()' 736 $ hg log -r 'unstable()'
738 cf306eb0d98f (draft): SPAM SPAM SPAM 737 56c68f64a3a0 (draft): SPAM SPAM SPAM
739 738
740 $ hg evolve 739 $ hg evolve
741 move:[17] SPAM SPAM SPAM 740 move:[17] SPAM SPAM SPAM
742 atop:[14] bathroom stuff 741 atop:[14] bathroom stuff
743 merging shopping 742 merging shopping
744 743
745 $ hg log -G 744 $ hg log -G
746 @ 7e0a7cf763e4 (draft): SPAM SPAM SPAM 745 @ 6dd8ca9dbcdc (draft): SPAM SPAM SPAM
747 | 746 |
748 o 30aa78f63aa1 (draft): bathroom stuff 747 o 36b5ba414186 (draft): bathroom stuff
749 | 748 |
750 o a2fccc2e7b08 (public): SPAM SPAM 749 o 02e33960e937 (public): SPAM SPAM
751 | 750 |
752 o 387187ad9bd9 (public): adding fruit 751 o 387187ad9bd9 (public): adding fruit
753 | 752 |
754 o dfd3a2d7691e (public): adding condiment 753 o dfd3a2d7691e (public): adding condiment
755 | 754 |