diff mercurial/hgweb/webcommands.py @ 31024:0b8356705de6

revset: split language services to revsetlang module (API) New revsetlang module hosts parser, tokenizer, and miscellaneous functions working on parsed tree. It does not include functions for evaluation such as getset() and match(). 2288 mercurial/revset.py 684 mercurial/revsetlang.py 2972 total get*() functions are aliased since they are common in revset.py.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 19 Feb 2017 18:19:33 +0900
parents aea06029919e
children abb92b3d370e
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py	Sun Feb 19 18:16:09 2017 +0900
+++ b/mercurial/hgweb/webcommands.py	Sun Feb 19 18:19:33 2017 +0900
@@ -32,6 +32,7 @@
     error,
     graphmod,
     revset,
+    revsetlang,
     scmutil,
     smartset,
     templatefilters,
@@ -239,20 +240,20 @@
 
         revdef = 'reverse(%s)' % query
         try:
-            tree = revset.parse(revdef)
+            tree = revsetlang.parse(revdef)
         except error.ParseError:
             # can't parse to a revset tree
             return MODE_KEYWORD, query
 
-        if revset.depth(tree) <= 2:
+        if revsetlang.depth(tree) <= 2:
             # no revset syntax used
             return MODE_KEYWORD, query
 
         if any((token, (value or '')[:3]) == ('string', 're:')
-                    for token, value, pos in revset.tokenize(revdef)):
+               for token, value, pos in revsetlang.tokenize(revdef)):
             return MODE_KEYWORD, query
 
-        funcsused = revset.funcsused(tree)
+        funcsused = revsetlang.funcsused(tree)
         if not funcsused.issubset(revset.safesymbols):
             return MODE_KEYWORD, query