diff 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
line wrap: on
line diff
--- a/tests/test-topic.t	Sat Aug 22 07:24:46 2020 +0800
+++ b/tests/test-topic.t	Tue Sep 01 23:35:43 2020 -0400
@@ -750,12 +750,18 @@
      fran (1 changesets)
   $ hg log -r 'topic(.)'
 (no output is expected)
+
+  $ hg up 8
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo test > gamma
+  $ hg ci -m non-topic
+  $ hg log -r 'topic(.)'
+
   $ hg co fran
   switching to topic fran
-  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg log -r 'topic(.)'
   changeset:   9:0469d521db49
-  tag:         tip
   topic:       fran
   parent:      3:a53952faf762
   user:        test
@@ -801,19 +807,26 @@
   created new head
   (consider using topic for lightweight branches. See 'hg help topic')
   $ hg log -Gr 'draft()'
-  @  changeset:   10:4073470c35e1
+  @  changeset:   11:4073470c35e1
   |  tag:         tip
+  |  parent:      9:0469d521db49
   |  user:        test
   |  date:        Thu Jan 01 00:00:00 1970 +0000
   |  summary:     fran?
   |
-  o  changeset:   9:0469d521db49
-  |  topic:       fran
-  |  parent:      3:a53952faf762
-  |  user:        test
-  |  date:        Thu Jan 01 00:00:00 1970 +0000
-  |  summary:     start on fran
-  |
+  | o  changeset:   10:de75ec1bdbe8
+  | |  parent:      8:ae074045b7a7
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  summary:     non-topic
+  | |
+  o |  changeset:   9:0469d521db49
+  | |  topic:       fran
+  | |  parent:      3:a53952faf762
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  summary:     start on fran
+  | |
 
   $ hg topics
      fran (1 changesets)