comparison tests/test-topic-stack.t @ 2917:044686b25cf7

tests: add tests for showing stack when merge is involved This patch adds tests of showing stack when merges are involved. This will help us in changing the behaviour and realising that in later patches.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 09 Sep 2017 22:32:44 +0530
parents 6b2ae9f2b9c4
children 0437158e0ed6
comparison
equal deleted inserted replaced
2916:17749d9d3968 2917:044686b25cf7
548 t3: c_h 548 t3: c_h
549 t2: c_g 549 t2: c_g
550 ^ c_D 550 ^ c_D
551 t1: c_f 551 t1: c_f
552 t0^ c_e (base) 552 t0^ c_e (base)
553
554 case involving a merge
555 ----------------------
556
557 $ cd ..
558 $ hg init stack-gap-merge
559 $ cd stack-gap-merge
560
561 $ echo aaa > aaa
562 $ hg commit -Am 'c_A'
563 adding aaa
564 $ hg topic red
565 $ echo bbb > bbb
566 $ hg commit -Am 'c_B'
567 adding bbb
568 $ echo ccc > ccc
569 $ hg commit -Am 'c_C'
570 adding ccc
571 $ hg topic blue
572 $ echo ddd > ddd
573 $ hg commit -Am 'c_D'
574 adding ddd
575 $ hg up 'desc("c_B")'
576 switching to topic red
577 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
578 $ echo eee > eee
579 $ hg commit -Am 'c_E'
580 adding eee
581 $ echo fff > fff
582 $ hg commit -Am 'c_F'
583 adding fff
584 $ hg topic blue
585 $ echo ggg > ggg
586 $ hg commit -Am 'c_G'
587 adding ggg
588 $ hg up 'desc("c_D")'
589 2 files updated, 0 files merged, 3 files removed, 0 files unresolved
590 $ hg topic red
591 $ hg merge 'desc("c_G")'
592 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
593 (branch merge, don't forget to commit)
594 $ hg commit -Am 'c_H'
595 $ hg topic blue
596 $ echo iii > iii
597 $ hg ci -Am 'c_I'
598 adding iii
599
600 $ hg log -G
601 @ 8 default {blue} draft c_I
602 |
603 o 7 default {red} draft c_H
604 |\
605 | o 6 default {blue} draft c_G
606 | |
607 | o 5 default {red} draft c_F
608 | |
609 | o 4 default {red} draft c_E
610 | |
611 o | 3 default {blue} draft c_D
612 | |
613 o | 2 default {red} draft c_C
614 |/
615 o 1 default {red} draft c_B
616 |
617 o 0 default {} draft c_A
618
619
620 $ hg stack red
621 ### topic: red (3 heads)
622 ### branch: default, 6 behind
623 t5: c_C
624 t2^ c_B (base)
625 t4: c_F
626 t3: c_E
627 t2: c_B
628 ^ c_A
629 t1: c_H
630 t0^ c_D (base)
631 $ hg stack blue
632 ### topic: blue (3 heads)
633 ### branch: default, ambigious rebase destination
634 t3: c_D
635 ^ c_C
636 t2: c_G
637 ^ c_F
638 t1@ c_I (current)
639 t0^ c_H (base)
640
641 Even with some obsolete and orphan changesets
642
643 (the ordering of each branch of "blue" change because their hash change. we
644 should stabilize this eventuelly)
645
646 $ hg up 'desc("c_B")'
647 switching to topic red
648 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
649 $ hg commit --amend --user test2
650 $ hg up 'desc("c_C")'
651 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
652 $ hg commit --amend --user test2
653 $ hg up 'desc("c_D")'
654 switching to topic blue
655 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
656 $ hg commit --amend --user test2
657
658 $ hg log -G --rev 'sort(all(), "topo")'
659 @ 11 default {blue} draft c_D
660 |
661 | o 8 default {blue} draft c_I
662 | |
663 | o 7 default {red} draft c_H
664 | |\
665 | | o 6 default {blue} draft c_G
666 | | |
667 | | o 5 default {red} draft c_F
668 | | |
669 | | o 4 default {red} draft c_E
670 | | |
671 | x | 3 default {blue} draft c_D
672 |/ /
673 x / 2 default {red} draft c_C
674 |/
675 | o 10 default {red} draft c_C
676 |/
677 x 1 default {red} draft c_B
678 |
679 | o 9 default {red} draft c_B
680 |/
681 o 0 default {} draft c_A
682
683
684 $ hg stack red
685 ### topic: red (3 heads)
686 ### branch: default, ambigious rebase destination
687 t5$ c_H (unstable)
688 ^ c_D
689 t4$ c_C (unstable)
690 t1^ c_B (base)
691 t3$ c_F (unstable)
692 t2$ c_E (unstable)
693 t1: c_B
694 t0^ c_A (base)
695 $ hg stack blue
696 ### topic: blue (3 heads)
697 ### branch: default, ambigious rebase destination
698 t3$ c_G (unstable)
699 ^ c_F
700 t2$ c_I (unstable)
701 ^ c_H
702 t1$ c_D (current unstable)
703 t0^ c_C (base)
704
705 more obsolescence
706
707 $ hg up 'max(desc("c_H"))'
708 switching to topic red
709 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
710 $ hg commit --amend --user test3
711 $ hg up 'max(desc("c_G"))'
712 switching to topic blue
713 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
714 $ hg commit --amend --user test3
715 $ hg up 'max(desc("c_B"))'
716 switching to topic red
717 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
718 $ hg commit --amend --user test3
719 $ hg up 'max(desc("c_C"))'
720 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
721 $ hg commit --amend --user test3
722 $ hg up 'max(desc("c_D"))'
723 switching to topic blue
724 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
725 $ hg commit --amend --user test3
726
727 $ hg log -G --rev 'sort(all(), "topo")'
728 @ 16 default {blue} draft c_D
729 |
730 | o 13 default {blue} draft c_G
731 | |
732 | | o 12 default {red} draft c_H
733 | | |\
734 | | | | o 8 default {blue} draft c_I
735 | | | | |
736 | | +---x 7 default {red} draft c_H
737 | | | |/
738 | +---x 6 default {blue} draft c_G
739 | | |
740 | o | 5 default {red} draft c_F
741 | | |
742 | o | 4 default {red} draft c_E
743 | | |
744 +---x 3 default {blue} draft c_D
745 | |
746 x | 2 default {red} draft c_C
747 |/
748 | o 15 default {red} draft c_C
749 |/
750 x 1 default {red} draft c_B
751 |
752 | o 14 default {red} draft c_B
753 |/
754 o 0 default {} draft c_A
755
756
757 $ hg stack red
758 ### topic: red (3 heads)
759 ### branch: default, ambigious rebase destination
760 t5$ c_H (unstable)
761 ^ c_D
762 t4$ c_F (unstable)
763 t3$ c_E (unstable)
764 t1^ c_B (base)
765 t2$ c_C (unstable)
766 t1: c_B
767 t0^ c_A (base)
768 $ hg stack blue
769 ### topic: blue (3 heads)
770 ### branch: default, ambigious rebase destination
771 t3$ c_I (unstable)
772 ^ c_H
773 t2$ c_G (unstable)
774 ^ c_F
775 t1$ c_D (current unstable)
776 t0^ c_C (base)