diff mercurial/debugcommands.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 d194f0dba7ac
children 2912b06905dc
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Sun Feb 19 18:16:09 2017 +0900
+++ b/mercurial/debugcommands.py	Sun Feb 19 18:19:33 2017 +0900
@@ -52,6 +52,7 @@
     repair,
     revlog,
     revset,
+    revsetlang,
     scmutil,
     setdiscovery,
     simplemerge,
@@ -1794,10 +1795,10 @@
     """
     stages = [
         ('parsed', lambda tree: tree),
-        ('expanded', lambda tree: revset.expandaliases(ui, tree)),
-        ('concatenated', revset.foldconcat),
-        ('analyzed', revset.analyze),
-        ('optimized', revset.optimize),
+        ('expanded', lambda tree: revsetlang.expandaliases(ui, tree)),
+        ('concatenated', revsetlang.foldconcat),
+        ('analyzed', revsetlang.analyze),
+        ('optimized', revsetlang.optimize),
     ]
     if opts['no_optimized']:
         stages = stages[:-1]
@@ -1826,13 +1827,13 @@
 
     treebystage = {}
     printedtree = None
-    tree = revset.parse(expr, lookup=repo.__contains__)
+    tree = revsetlang.parse(expr, lookup=repo.__contains__)
     for n, f in stages:
         treebystage[n] = tree = f(tree)
         if n in showalways or (n in showchanged and tree != printedtree):
             if opts['show_stage'] or n != 'parsed':
                 ui.write(("* %s:\n") % n)
-            ui.write(revset.prettyformat(tree), "\n")
+            ui.write(revsetlang.prettyformat(tree), "\n")
             printedtree = tree
 
     if opts['verify_optimized']: