diff mercurial/scmutil.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 d524c88511a7
children 6cf2857526c7
line wrap: on
line diff
--- a/mercurial/scmutil.py	Sun Feb 19 18:16:09 2017 +0900
+++ b/mercurial/scmutil.py	Sun Feb 19 18:19:33 2017 +0900
@@ -30,6 +30,7 @@
     phases,
     pycompat,
     revset,
+    revsetlang,
     similar,
     util,
 )
@@ -890,7 +891,7 @@
     return repo[l.last()]
 
 def _pairspec(revspec):
-    tree = revset.parse(revspec)
+    tree = revsetlang.parse(revspec)
     return tree and tree[0] in ('range', 'rangepre', 'rangepost', 'rangeall')
 
 def revpair(repo, revs):
@@ -936,7 +937,7 @@
     revision numbers.
 
     It is assumed the revsets are already formatted. If you have arguments
-    that need to be expanded in the revset, call ``revset.formatspec()``
+    that need to be expanded in the revset, call ``revsetlang.formatspec()``
     and pass the result as an element of ``specs``.
 
     Specifying a single revset is allowed.
@@ -947,7 +948,7 @@
     allspecs = []
     for spec in specs:
         if isinstance(spec, int):
-            spec = revset.formatspec('rev(%d)', spec)
+            spec = revsetlang.formatspec('rev(%d)', spec)
         allspecs.append(spec)
     m = revset.matchany(repo.ui, allspecs, repo)
     return m(repo)