--- a/hgext3rd/topic/revset.py Fri Aug 31 00:31:01 2018 +0200
+++ b/hgext3rd/topic/revset.py Thu Aug 30 17:42:11 2018 +0800
@@ -33,16 +33,17 @@
TODO: make `topic(revset)` work the same as `branch(revset)`.
"""
args = revset.getargs(x, 0, 1, 'topic takes one or no arguments')
- if args:
+
+ mutable = revset._notpublic(repo, revset.fullreposet(repo), ())
+
+ if not args:
+ return (subset & mutable).filter(lambda r: bool(repo[r].topic()))
+ else:
# match a specific topic
topic = revset.getstring(args[0], 'topic() argument must be a string')
if topic == '.':
topic = repo['.'].extra().get('topic', '')
_kind, _pattern, matcher = mkmatcher(topic)
- else:
- matcher = lambda t: bool(t)
-
- mutable = revset._notpublic(repo, revset.fullreposet(repo), ())
rawchange = repo.changelog.changelogrevision
key = constants.extrakey