hgext3rd/topic/revset.py
changeset 4064 a2c0133006c6
parent 4063 00c65abf99cd
child 4095 aabf436c11cb
--- a/hgext3rd/topic/revset.py	Sat Sep 01 21:47:00 2018 +0200
+++ b/hgext3rd/topic/revset.py	Sat Sep 01 14:00:41 2018 +0200
@@ -61,17 +61,10 @@
             # note: falls through to the revset case if no topic with this name
             # exists and pattern kind is not specified explicitly
 
-            alltopics = set([repo.currenttopic])
-            for r in repo.unfiltered().set('all()'):
-                alltopics.add(r.topic(force=True))
-            alltopics.discard('')
-
-            if pattern in alltopics:
-                return (subset & mutable).filter(matches)
-
-            if topic.startswith('literal:'):
+            if pattern not in repo.topics and topic.startswith('literal:'):
                 raise error.RepoLookupError("topic '%s' does not exist"
                                             % pattern)
+            return (subset & mutable).filter(matches)
         else:
             return (subset & mutable).filter(matches)