comparison tests/test-topic.t @ 5507:95478db35f88 stable

topic: fix the `topic(...)` revset to not select commits without a topic The problem seems to be that the now removed __contains__ check would select any revision indicated by a non-string argument. This led to `topic(head())` returning a bunch of non-topic heads, though not as many as simply `head()`. I'm likely misunderstanding something, because there appears to be a similar __contains__ check for `branch()` in core. But maybe that's just harder to see the issue, because branch names doesn't disappear like topics.
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 01 Sep 2020 23:35:43 -0400
parents 19b8ffd23795
children e77c86e83fb4 5a70669beaa3 044ce00dfa88
comparison
equal deleted inserted replaced
5502:77c0ddd6f172 5507:95478db35f88
748 Match current topic: 748 Match current topic:
749 $ hg topic 749 $ hg topic
750 fran (1 changesets) 750 fran (1 changesets)
751 $ hg log -r 'topic(.)' 751 $ hg log -r 'topic(.)'
752 (no output is expected) 752 (no output is expected)
753
754 $ hg up 8
755 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
756 $ echo test > gamma
757 $ hg ci -m non-topic
758 $ hg log -r 'topic(.)'
759
753 $ hg co fran 760 $ hg co fran
754 switching to topic fran 761 switching to topic fran
755 2 files updated, 0 files merged, 0 files removed, 0 files unresolved 762 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
756 $ hg log -r 'topic(.)' 763 $ hg log -r 'topic(.)'
757 changeset: 9:0469d521db49 764 changeset: 9:0469d521db49
758 tag: tip
759 topic: fran 765 topic: fran
760 parent: 3:a53952faf762 766 parent: 3:a53952faf762
761 user: test 767 user: test
762 date: Thu Jan 01 00:00:00 1970 +0000 768 date: Thu Jan 01 00:00:00 1970 +0000
763 summary: start on fran 769 summary: start on fran
799 $ echo fran? >> beta 805 $ echo fran? >> beta
800 $ hg ci -m 'fran?' 806 $ hg ci -m 'fran?'
801 created new head 807 created new head
802 (consider using topic for lightweight branches. See 'hg help topic') 808 (consider using topic for lightweight branches. See 'hg help topic')
803 $ hg log -Gr 'draft()' 809 $ hg log -Gr 'draft()'
804 @ changeset: 10:4073470c35e1 810 @ changeset: 11:4073470c35e1
805 | tag: tip 811 | tag: tip
812 | parent: 9:0469d521db49
806 | user: test 813 | user: test
807 | date: Thu Jan 01 00:00:00 1970 +0000 814 | date: Thu Jan 01 00:00:00 1970 +0000
808 | summary: fran? 815 | summary: fran?
809 | 816 |
810 o changeset: 9:0469d521db49 817 | o changeset: 10:de75ec1bdbe8
811 | topic: fran 818 | | parent: 8:ae074045b7a7
812 | parent: 3:a53952faf762 819 | | user: test
813 | user: test 820 | | date: Thu Jan 01 00:00:00 1970 +0000
814 | date: Thu Jan 01 00:00:00 1970 +0000 821 | | summary: non-topic
815 | summary: start on fran 822 | |
816 | 823 o | changeset: 9:0469d521db49
824 | | topic: fran
825 | | parent: 3:a53952faf762
826 | | user: test
827 | | date: Thu Jan 01 00:00:00 1970 +0000
828 | | summary: start on fran
829 | |
817 830
818 $ hg topics 831 $ hg topics
819 fran (1 changesets) 832 fran (1 changesets)
820 833
821 Testing for updating to s0 834 Testing for updating to s0