diff src/topic/revset.py @ 1865:558dd43b599d

topic: work around stringmatcher moving during development of hg 3.6
author Augie Fackler <raf@durin42.com>
date Wed, 14 Oct 2015 12:09:11 -0400
parents 70d1191fceed
children 8dd5200b4086
line wrap: on
line diff
--- a/src/topic/revset.py	Wed Sep 30 18:06:42 2015 -0400
+++ b/src/topic/revset.py	Wed Oct 14 12:09:11 2015 -0400
@@ -1,7 +1,14 @@
 from mercurial import revset
+from mercurial import util
 
 from . import constants
 
+try:
+    mkmatcher = revset._stringmatcher
+except AttributeError:
+    mkmatcher = util.stringmatcher
+
+
 def topicset(repo, subset, x):
     """`topic([topic])`
     Specified topic or all changes with any topic specified.
@@ -17,7 +24,7 @@
         topic = revset.getstring(args[0], 'topic() argument must be a string')
         if topic == '.':
             topic = repo['.'].extra().get('topic', '')
-        _kind, _pattern, matcher = revset._stringmatcher(topic)
+        _kind, _pattern, matcher = mkmatcher(topic)
     else:
         matcher = lambda t: bool(t)
     drafts = subset.filter(lambda r: repo[r].mutable())