revset: drop special case of 'revset(...)' function in analyze
authorBoris Feld <boris.feld@octobus.net>
Thu, 11 Oct 2018 03:15:04 +0200
changeset 40311 4aa04d009167
parent 40310 d894d2372ffe
child 40312 5644f7c8982e
revset: drop special case of 'revset(...)' function in analyze We now have a valid no-op function. We no longer need the special case.
mercurial/revsetlang.py
tests/test-revset.t
--- a/mercurial/revsetlang.py	Thu Oct 11 03:13:53 2018 +0200
+++ b/mercurial/revsetlang.py	Thu Oct 11 03:15:04 2018 +0200
@@ -355,9 +355,6 @@
     elif op == 'keyvalue':
         return (op, x[1], _analyze(x[2]))
     elif op == 'func':
-        f = getsymbol(x[1])
-        if f == 'revset':
-            return _analyze(x[2])
         return (op, x[1], _analyze(x[2]))
     raise ValueError('invalid operator %r' % op)
 
--- a/tests/test-revset.t	Thu Oct 11 03:13:53 2018 +0200
+++ b/tests/test-revset.t	Thu Oct 11 03:15:04 2018 +0200
@@ -2926,16 +2926,20 @@
         (symbol '0'))))
   * analyzed:
   (func
-    (symbol 'first')
+    (symbol 'revset')
     (func
-      (symbol 'rev')
-      (symbol '0')))
+      (symbol 'first')
+      (func
+        (symbol 'rev')
+        (symbol '0'))))
   * optimized:
   (func
-    (symbol 'first')
+    (symbol 'revset')
     (func
-      (symbol 'rev')
-      (symbol '0')))
+      (symbol 'first')
+      (func
+        (symbol 'rev')
+        (symbol '0'))))
   * set:
   <baseset+ [0]>
   0