Mercurial > evolve
comparison tests/test-topic.t @ 2649:cf930521f14d
topics: add some noise to rewrittent changeset to prevent hash cycle
If we have a changeset with topic `x`, we change it's topic to `y`, fine.
When we change it's topic back again to `x`, we get the hash of the the
obsoleted changeset which had the topic `x` initially. The same happens for few
more cases like clearing the topic of a changeset which initially had no topic.
This approach is influenced from cmdutil.amend and other commands (rebase, histedit, etc…)
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Wed, 21 Jun 2017 07:32:11 +0530 |
parents | d8b47d961c77 |
children | 914757c70217 |
comparison
equal
deleted
inserted
replaced
2648:d8b47d961c77 | 2649:cf930521f14d |
---|---|
554 Can clear topics | 554 Can clear topics |
555 $ hg topic --rev 9 --clear | 555 $ hg topic --rev 9 --clear |
556 changed topic on 1 changes | 556 changed topic on 1 changes |
557 please run hg evolve --rev "not topic()" now | 557 please run hg evolve --rev "not topic()" now |
558 $ hg log -Gr 'draft() and not obsolete()' | 558 $ hg log -Gr 'draft() and not obsolete()' |
559 o changeset: 11:783930e1d79e | 559 o changeset: 11:0beca5ab56c3 |
560 | tag: tip | 560 | tag: tip |
561 | parent: 3:a53952faf762 | 561 | parent: 3:a53952faf762 |
562 | user: test | 562 | user: test |
563 | date: Thu Jan 01 00:00:00 1970 +0000 | 563 | date: Thu Jan 01 00:00:00 1970 +0000 |
564 | summary: start on fran | 564 | summary: start on fran |
579 Can add a topic to an existing change | 579 Can add a topic to an existing change |
580 $ hg topic --rev 11 wat | 580 $ hg topic --rev 11 wat |
581 changed topic on 1 changes | 581 changed topic on 1 changes |
582 please run hg evolve --rev "topic(wat)" now | 582 please run hg evolve --rev "topic(wat)" now |
583 $ hg log -Gr 'draft() and not obsolete()' | 583 $ hg log -Gr 'draft() and not obsolete()' |
584 o changeset: 13:d91cd8fd490e | 584 o changeset: 13:686a642006db |
585 | tag: tip | 585 | tag: tip |
586 | topic: wat | 586 | topic: wat |
587 | parent: 3:a53952faf762 | 587 | parent: 3:a53952faf762 |
588 | user: test | 588 | user: test |
589 | date: Thu Jan 01 00:00:00 1970 +0000 | 589 | date: Thu Jan 01 00:00:00 1970 +0000 |
590 | summary: start on fran | 590 | summary: start on fran |
591 | | 591 | |
592 | @ changeset: 12:d9e32f4c4806 | 592 | @ changeset: 12:18b70b8de1f0 |
593 | | user: test | 593 | | user: test |
594 | | date: Thu Jan 01 00:00:00 1970 +0000 | 594 | | date: Thu Jan 01 00:00:00 1970 +0000 |
595 | | trouble: unstable | 595 | | trouble: unstable |
596 | | summary: fran? | 596 | | summary: fran? |
597 | | | 597 | | |
598 | 598 |
599 Normally you'd do this with evolve, but we'll use rebase to avoid | 599 Normally you'd do this with evolve, but we'll use rebase to avoid |
600 bonus deps in the testsuite. | 600 bonus deps in the testsuite. |
601 | 601 |
602 $ hg rebase -d tip -s . | 602 $ hg rebase -d tip -s . |
603 rebasing 12:d9e32f4c4806 "fran?" | 603 rebasing 12:18b70b8de1f0 "fran?" |
604 | 604 |
605 $ hg log -Gr 'draft()' | 605 $ hg log -Gr 'draft()' |
606 @ changeset: 14:cf24ad8bbef5 | 606 @ changeset: 14:503497a14c3e |
607 | tag: tip | 607 | tag: tip |
608 | topic: wat | 608 | topic: wat |
609 | user: test | 609 | user: test |
610 | date: Thu Jan 01 00:00:00 1970 +0000 | 610 | date: Thu Jan 01 00:00:00 1970 +0000 |
611 | summary: fran? | 611 | summary: fran? |
612 | | 612 | |
613 o changeset: 13:d91cd8fd490e | 613 o changeset: 13:686a642006db |
614 | topic: wat | 614 | topic: wat |
615 | parent: 3:a53952faf762 | 615 | parent: 3:a53952faf762 |
616 | user: test | 616 | user: test |
617 | date: Thu Jan 01 00:00:00 1970 +0000 | 617 | date: Thu Jan 01 00:00:00 1970 +0000 |
618 | summary: start on fran | 618 | summary: start on fran |
621 Amend a topic | 621 Amend a topic |
622 | 622 |
623 $ hg topic watwat | 623 $ hg topic watwat |
624 $ hg ci --amend | 624 $ hg ci --amend |
625 $ hg log -Gr 'draft()' | 625 $ hg log -Gr 'draft()' |
626 @ changeset: 16:893ffcf66c1f | 626 @ changeset: 16:024d9c69f30f |
627 | tag: tip | 627 | tag: tip |
628 | topic: watwat | 628 | topic: watwat |
629 | parent: 13:d91cd8fd490e | 629 | parent: 13:686a642006db |
630 | user: test | 630 | user: test |
631 | date: Thu Jan 01 00:00:00 1970 +0000 | 631 | date: Thu Jan 01 00:00:00 1970 +0000 |
632 | summary: fran? | 632 | summary: fran? |
633 | | 633 | |
634 o changeset: 13:d91cd8fd490e | 634 o changeset: 13:686a642006db |
635 | topic: wat | 635 | topic: wat |
636 | parent: 3:a53952faf762 | 636 | parent: 3:a53952faf762 |
637 | user: test | 637 | user: test |
638 | date: Thu Jan 01 00:00:00 1970 +0000 | 638 | date: Thu Jan 01 00:00:00 1970 +0000 |
639 | summary: start on fran | 639 | summary: start on fran |
642 Clear and amend: | 642 Clear and amend: |
643 | 643 |
644 $ hg topic --clear | 644 $ hg topic --clear |
645 $ hg ci --amend | 645 $ hg ci --amend |
646 $ hg log -r . | 646 $ hg log -r . |
647 changeset: 18:a13639e22b65 | 647 changeset: 18:573ab57c6de2 |
648 tag: tip | 648 tag: tip |
649 parent: 13:d91cd8fd490e | 649 parent: 13:686a642006db |
650 user: test | 650 user: test |
651 date: Thu Jan 01 00:00:00 1970 +0000 | 651 date: Thu Jan 01 00:00:00 1970 +0000 |
652 summary: fran? | 652 summary: fran? |
653 | 653 |
654 Reading the same topic with topic --rev should work: | 654 Reading the same topic with topic --rev should work: |
659 | 659 |
660 Testing issue5441 | 660 Testing issue5441 |
661 $ hg co 19 | 661 $ hg co 19 |
662 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | 662 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
663 $ hg log -Gr 'draft()' | 663 $ hg log -Gr 'draft()' |
664 @ changeset: 19:b72b86a1f96b | 664 @ changeset: 19:2539ecb09b37 |
665 | tag: tip | 665 | tag: tip |
666 | topic: watwat | 666 | topic: watwat |
667 | parent: 13:d91cd8fd490e | 667 | parent: 13:686a642006db |
668 | user: test | 668 | user: test |
669 | date: Thu Jan 01 00:00:00 1970 +0000 | 669 | date: Thu Jan 01 00:00:00 1970 +0000 |
670 | summary: fran? | 670 | summary: fran? |
671 | | 671 | |
672 o changeset: 13:d91cd8fd490e | 672 o changeset: 13:686a642006db |
673 | topic: wat | 673 | topic: wat |
674 | parent: 3:a53952faf762 | 674 | parent: 3:a53952faf762 |
675 | user: test | 675 | user: test |
676 | date: Thu Jan 01 00:00:00 1970 +0000 | 676 | date: Thu Jan 01 00:00:00 1970 +0000 |
677 | summary: start on fran | 677 | summary: start on fran |
681 switching to topic changewat | 681 switching to topic changewat |
682 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | 682 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
683 changed topic on 2 changes | 683 changed topic on 2 changes |
684 please run hg evolve --rev "topic(changewat)" now | 684 please run hg evolve --rev "topic(changewat)" now |
685 $ hg log -Gr 'draft()' | 685 $ hg log -Gr 'draft()' |
686 @ changeset: 21:58e15a6365ca | 686 @ changeset: 21:993d145391f5 |
687 | tag: tip | 687 | tag: tip |
688 | topic: changewat | 688 | topic: changewat |
689 | user: test | 689 | user: test |
690 | date: Thu Jan 01 00:00:00 1970 +0000 | 690 | date: Thu Jan 01 00:00:00 1970 +0000 |
691 | summary: fran? | 691 | summary: fran? |
692 | | 692 | |
693 o changeset: 20:a96ac830b62e | 693 o changeset: 20:ceba5be9d56f |
694 | topic: changewat | 694 | topic: changewat |
695 | parent: 3:a53952faf762 | 695 | parent: 3:a53952faf762 |
696 | user: test | 696 | user: test |
697 | date: Thu Jan 01 00:00:00 1970 +0000 | 697 | date: Thu Jan 01 00:00:00 1970 +0000 |
698 | summary: start on fran | 698 | summary: start on fran |
705 $ hg up t1 | 705 $ hg up t1 |
706 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 706 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
707 $ echo gamma >> gamma | 707 $ echo gamma >> gamma |
708 $ hg ci -m gamma | 708 $ hg ci -m gamma |
709 $ hg log -Gr 'draft()' | 709 $ hg log -Gr 'draft()' |
710 @ changeset: 22:373f490f8854 | 710 @ changeset: 22:0d3d805542b4 |
711 | tag: tip | 711 | tag: tip |
712 | topic: changewat | 712 | topic: changewat |
713 | parent: 20:a96ac830b62e | 713 | parent: 20:ceba5be9d56f |
714 | user: test | 714 | user: test |
715 | date: Thu Jan 01 00:00:00 1970 +0000 | 715 | date: Thu Jan 01 00:00:00 1970 +0000 |
716 | summary: gamma | 716 | summary: gamma |
717 | | 717 | |
718 | o changeset: 21:58e15a6365ca | 718 | o changeset: 21:993d145391f5 |
719 |/ topic: changewat | 719 |/ topic: changewat |
720 | user: test | 720 | user: test |
721 | date: Thu Jan 01 00:00:00 1970 +0000 | 721 | date: Thu Jan 01 00:00:00 1970 +0000 |
722 | summary: fran? | 722 | summary: fran? |
723 | | 723 | |
724 o changeset: 20:a96ac830b62e | 724 o changeset: 20:ceba5be9d56f |
725 | topic: changewat | 725 | topic: changewat |
726 | parent: 3:a53952faf762 | 726 | parent: 3:a53952faf762 |
727 | user: test | 727 | user: test |
728 | date: Thu Jan 01 00:00:00 1970 +0000 | 728 | date: Thu Jan 01 00:00:00 1970 +0000 |
729 | summary: start on fran | 729 | summary: start on fran |
732 switching to topic changewut | 732 switching to topic changewut |
733 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | 733 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
734 changed topic on 3 changes | 734 changed topic on 3 changes |
735 please run hg evolve --rev "topic(changewut)" now | 735 please run hg evolve --rev "topic(changewut)" now |
736 $ hg log -Gr 'draft()' | 736 $ hg log -Gr 'draft()' |
737 @ changeset: 25:05d1bf93e1d8 | 737 @ changeset: 25:729ed5717393 |
738 | tag: tip | 738 | tag: tip |
739 | topic: changewut | 739 | topic: changewut |
740 | parent: 23:1f668635e0c2 | 740 | parent: 23:62e49f09f883 |
741 | user: test | 741 | user: test |
742 | date: Thu Jan 01 00:00:00 1970 +0000 | 742 | date: Thu Jan 01 00:00:00 1970 +0000 |
743 | summary: gamma | 743 | summary: gamma |
744 | | 744 | |
745 | o changeset: 24:696f1024fbfb | 745 | o changeset: 24:658ae31a0c05 |
746 |/ topic: changewut | 746 |/ topic: changewut |
747 | user: test | 747 | user: test |
748 | date: Thu Jan 01 00:00:00 1970 +0000 | 748 | date: Thu Jan 01 00:00:00 1970 +0000 |
749 | summary: fran? | 749 | summary: fran? |
750 | | 750 | |
751 o changeset: 23:1f668635e0c2 | 751 o changeset: 23:62e49f09f883 |
752 | topic: changewut | 752 | topic: changewut |
753 | parent: 3:a53952faf762 | 753 | parent: 3:a53952faf762 |
754 | user: test | 754 | user: test |
755 | date: Thu Jan 01 00:00:00 1970 +0000 | 755 | date: Thu Jan 01 00:00:00 1970 +0000 |
756 | summary: start on fran | 756 | summary: start on fran |