topic: handle string argument to topic() revset earlier
authorAnton Shestakov <av6@dwimlabs.net>
Thu, 30 Aug 2018 19:13:56 +0800
changeset 4059 1914a53fe792
parent 4058 90783c9c8609
child 4060 54eade86ac31
topic: handle string argument to topic() revset earlier
hgext3rd/topic/revset.py
--- a/hgext3rd/topic/revset.py	Thu Aug 30 18:02:41 2018 +0800
+++ b/hgext3rd/topic/revset.py	Thu Aug 30 19:13:56 2018 +0800
@@ -50,6 +50,15 @@
             topic = repo['.'].extra().get('topic', '')
         _kind, _pattern, matcher = mkmatcher(topic)
 
+        def matches(r):
+            topic = repo[r].topic()
+            if not topic:
+                return False
+            return matcher(topic)
+
+        if True:
+            return (subset & mutable).filter(matches)
+
     rawchange = repo.changelog.changelogrevision
     key = constants.extrakey