Skip to content
Snippets Groups Projects
Commit 95478db3 authored by Matt Harbison's avatar Matt Harbison
Browse files

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.
parent 77c0ddd6
No related branches found
No related tags found
1 merge request!235topic: fix the `topic(...)` revset to not select commits without a topic
Pipeline #37713 passed
......@@ -10,6 +10,8 @@
* split: correctly handle discard action after previously splitting changes
into more than one commit
* revset: no longer changeset without topic when running `topic(REVSET)`
10.0.1 -- 2020-07-31
--------------------
......
......@@ -67,8 +67,6 @@
topics.discard(b'')
def matches(r):
if r in s:
return True
topic = repo[r].topic()
if not topic:
return False
......
......@@ -750,5 +750,12 @@
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
......@@ -753,5 +760,5 @@
$ 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
......@@ -756,6 +763,5 @@
$ hg log -r 'topic(.)'
changeset: 9:0469d521db49
tag: tip
topic: fran
parent: 3:a53952faf762
user: test
......@@ -801,5 +807,5 @@
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
......@@ -805,5 +811,6 @@
| tag: tip
| parent: 9:0469d521db49
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: fran?
|
......@@ -806,14 +813,20 @@
| 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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment