[PATCH 2 of 2] revset: drop special case of 'revset(...)' function in analyze

Boris Feld boris.feld at octobus.net
Tue Oct 16 06:09:02 EDT 2018


# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1539220504 -7200
#      Thu Oct 11 03:15:04 2018 +0200
# Node ID c1241e62986a91ebaf5a421c6d78560113be7111
# Parent  16ae7c19c2a2bb89ad4d201630cd87f6c635b7e0
# EXP-Topic revset-doc
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r c1241e62986a
revset: drop special case of 'revset(...)' function in analyze

We now have a valid no-op function. We no longer need the special case.

diff --git a/mercurial/revsetlang.py b/mercurial/revsetlang.py
--- a/mercurial/revsetlang.py
+++ b/mercurial/revsetlang.py
@@ -355,9 +355,6 @@ def _analyze(x):
     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)
 
diff --git a/tests/test-revset.t b/tests/test-revset.t
--- a/tests/test-revset.t
+++ b/tests/test-revset.t
@@ -2926,16 +2926,20 @@ test multiline revset with errors
         (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


More information about the Mercurial-devel mailing list