parser: stabilize output of prettyformat() by using byte-safe repr()
authorYuya Nishihara <yuya@tcha.org>
Sun, 03 Sep 2017 21:17:25 +0900
changeset 34073 7bbc4e113e5f
parent 34072 30535fe47e78
child 34074 abf91c4f9608
parser: stabilize output of prettyformat() by using byte-safe repr() The format of leaf nodes is slightly changed so they look more similar to internal nodes.
mercurial/parser.py
mercurial/templater.py
tests/test-command-template.t
tests/test-fileset.t
tests/test-glog.t
tests/test-revset-dirstate-parents.t
tests/test-revset.t
--- a/mercurial/parser.py	Sun Sep 03 17:51:23 2017 +0900
+++ b/mercurial/parser.py	Sun Sep 03 21:17:25 2017 +0900
@@ -20,6 +20,7 @@
 
 from .i18n import _
 from . import (
+    encoding,
     error,
     util,
 )
@@ -193,9 +194,17 @@
         # mangle Python's exception into our format
         raise error.ParseError(str(e).lower())
 
+def _brepr(obj):
+    if isinstance(obj, bytes):
+        return b"'%s'" % util.escapestr(obj)
+    return encoding.strtolocal(repr(obj))
+
 def _prettyformat(tree, leafnodes, level, lines):
-    if not isinstance(tree, tuple) or tree[0] in leafnodes:
-        lines.append((level, str(tree)))
+    if not isinstance(tree, tuple):
+        lines.append((level, _brepr(tree)))
+    elif tree[0] in leafnodes:
+        rs = map(_brepr, tree[1:])
+        lines.append((level, '(%s %s)' % (tree[0], ' '.join(rs))))
     else:
         lines.append((level, '(%s' % tree[0]))
         for s in tree[1:]:
@@ -219,9 +228,9 @@
     ...       ('symbol', '2')),
     ...     ('symbol', '3')))
     (or
-      ('symbol', '1')
-      ('symbol', '2')
-      ('symbol', '3'))
+      (symbol '1')
+      (symbol '2')
+      (symbol '3'))
     >>> f(('func',
     ...     ('symbol', 'p1'),
     ...     ('or',
@@ -246,25 +255,25 @@
     ...               ('symbol', '7'))))),
     ...       ('symbol', '8'))))
     (func
-      ('symbol', 'p1')
+      (symbol 'p1')
       (or
         (func
-          ('symbol', 'sort')
+          (symbol 'sort')
           (list
             (or
-              ('symbol', '1')
-              ('symbol', '2')
-              ('symbol', '3'))
+              (symbol '1')
+              (symbol '2')
+              (symbol '3'))
             (negate
-              ('symbol', 'rev'))))
+              (symbol 'rev'))))
         (and
-          ('symbol', '4')
+          (symbol '4')
           (group
             (or
-              ('symbol', '5')
-              ('symbol', '6')
-              ('symbol', '7'))))
-        ('symbol', '8')))
+              (symbol '5')
+              (symbol '6')
+              (symbol '7'))))
+        (symbol '8')))
     """
     if not isinstance(tree, tuple):
         return tree
@@ -561,8 +570,8 @@
         >>> args = ['$1', '$2', 'foo']
         >>> pprint(builddefn('$1 or foo', args))
         (or
-          ('_aliasarg', '$1')
-          ('_aliasarg', 'foo'))
+          (_aliasarg '$1')
+          (_aliasarg 'foo'))
         >>> try:
         ...     builddefn('$1 or $bar', args)
         ... except error.ParseError as inst:
@@ -571,12 +580,12 @@
         >>> args = ['$1', '$10', 'foo']
         >>> pprint(builddefn('$10 or baz', args))
         (or
-          ('_aliasarg', '$10')
-          ('symbol', 'baz'))
+          (_aliasarg '$10')
+          (symbol 'baz'))
         >>> pprint(builddefn('"$1" or "foo"', args))
         (or
-          ('string', '$1')
-          ('string', 'foo'))
+          (string '$1')
+          (string 'foo'))
         """
         tree = cls._parse(defn)
         if args:
--- a/mercurial/templater.py	Sun Sep 03 17:51:23 2017 +0900
+++ b/mercurial/templater.py	Sun Sep 03 21:17:25 2017 +0900
@@ -194,18 +194,18 @@
     >>> def f(tree):
     ...     print prettyformat(_unnesttemplatelist(tree))
     >>> f(('template', []))
-    ('string', '')
+    (string '')
     >>> f(('template', [('string', 'foo')]))
-    ('string', 'foo')
+    (string 'foo')
     >>> f(('template', [('string', 'foo'), ('symbol', 'rev')]))
     (template
-      ('string', 'foo')
-      ('symbol', 'rev'))
+      (string 'foo')
+      (symbol 'rev'))
     >>> f(('template', [('symbol', 'rev')]))  # template(rev) -> str
     (template
-      ('symbol', 'rev'))
+      (symbol 'rev'))
     >>> f(('template', [('template', [('string', 'foo')])]))
-    ('string', 'foo')
+    (string 'foo')
     """
     if not isinstance(tree, tuple):
         return tree
--- a/tests/test-command-template.t	Sun Sep 03 17:51:23 2017 +0900
+++ b/tests/test-command-template.t	Sun Sep 03 21:17:25 2017 +0900
@@ -41,62 +41,62 @@
   $ hg debugtemplate -r0 -v '{5 / 2} {mod(5, 2)}\n'
   (template
     (/
-      ('integer', '5')
-      ('integer', '2'))
-    ('string', ' ')
+      (integer '5')
+      (integer '2'))
+    (string ' ')
     (func
-      ('symbol', 'mod')
+      (symbol 'mod')
       (list
-        ('integer', '5')
-        ('integer', '2')))
-    ('string', '\n'))
+        (integer '5')
+        (integer '2')))
+    (string '\n'))
   2 1
   $ hg debugtemplate -r0 -v '{5 / -2} {mod(5, -2)}\n'
   (template
     (/
-      ('integer', '5')
+      (integer '5')
       (negate
-        ('integer', '2')))
-    ('string', ' ')
+        (integer '2')))
+    (string ' ')
     (func
-      ('symbol', 'mod')
+      (symbol 'mod')
       (list
-        ('integer', '5')
+        (integer '5')
         (negate
-          ('integer', '2'))))
-    ('string', '\n'))
+          (integer '2'))))
+    (string '\n'))
   -3 -1
   $ hg debugtemplate -r0 -v '{-5 / 2} {mod(-5, 2)}\n'
   (template
     (/
       (negate
-        ('integer', '5'))
-      ('integer', '2'))
-    ('string', ' ')
+        (integer '5'))
+      (integer '2'))
+    (string ' ')
     (func
-      ('symbol', 'mod')
+      (symbol 'mod')
       (list
         (negate
-          ('integer', '5'))
-        ('integer', '2')))
-    ('string', '\n'))
+          (integer '5'))
+        (integer '2')))
+    (string '\n'))
   -3 1
   $ hg debugtemplate -r0 -v '{-5 / -2} {mod(-5, -2)}\n'
   (template
     (/
       (negate
-        ('integer', '5'))
+        (integer '5'))
       (negate
-        ('integer', '2')))
-    ('string', ' ')
+        (integer '2')))
+    (string ' ')
     (func
-      ('symbol', 'mod')
+      (symbol 'mod')
       (list
         (negate
-          ('integer', '5'))
+          (integer '5'))
         (negate
-          ('integer', '2'))))
-    ('string', '\n'))
+          (integer '2'))))
+    (string '\n'))
   2 -1
 
 Filters bind closer than arithmetic:
@@ -106,11 +106,11 @@
     (-
       (|
         (func
-          ('symbol', 'revset')
-          ('string', '.'))
-        ('symbol', 'count'))
-      ('integer', '1'))
-    ('string', '\n'))
+          (symbol 'revset')
+          (string '.'))
+        (symbol 'count'))
+      (integer '1'))
+    (string '\n'))
   0
 
 But negate binds closer still:
@@ -118,20 +118,20 @@
   $ hg debugtemplate -r0 -v '{1-3|stringify}\n'
   (template
     (-
-      ('integer', '1')
+      (integer '1')
       (|
-        ('integer', '3')
-        ('symbol', 'stringify')))
-    ('string', '\n'))
+        (integer '3')
+        (symbol 'stringify')))
+    (string '\n'))
   hg: parse error: arithmetic only defined on integers
   [255]
   $ hg debugtemplate -r0 -v '{-3|stringify}\n'
   (template
     (|
       (negate
-        ('integer', '3'))
-      ('symbol', 'stringify'))
-    ('string', '\n'))
+        (integer '3'))
+      (symbol 'stringify'))
+    (string '\n'))
   -3
 
 Keyword arguments:
@@ -139,10 +139,10 @@
   $ hg debugtemplate -r0 -v '{foo=bar|baz}'
   (template
     (keyvalue
-      ('symbol', 'foo')
+      (symbol 'foo')
       (|
-        ('symbol', 'bar')
-        ('symbol', 'baz'))))
+        (symbol 'bar')
+        (symbol 'baz'))))
   hg: parse error: can't use a key-value pair in this context
   [255]
 
@@ -3174,21 +3174,21 @@
   $ hg debugtemplate -v '{(0)}\n'
   (template
     (group
-      ('integer', '0'))
-    ('string', '\n'))
+      (integer '0'))
+    (string '\n'))
   0
   $ hg debugtemplate -v '{(123)}\n'
   (template
     (group
-      ('integer', '123'))
-    ('string', '\n'))
+      (integer '123'))
+    (string '\n'))
   123
   $ hg debugtemplate -v '{(-4)}\n'
   (template
     (group
       (negate
-        ('integer', '4')))
-    ('string', '\n'))
+        (integer '4')))
+    (string '\n'))
   -4
   $ hg debugtemplate '{(-)}\n'
   hg: parse error at 3: not a prefix: )
@@ -3201,25 +3201,25 @@
 
   $ hg debugtemplate -D 1=one -v '{1}\n'
   (template
-    ('integer', '1')
-    ('string', '\n'))
+    (integer '1')
+    (string '\n'))
   one
   $ hg debugtemplate -D 1=one -v '{if("t", "{1}")}\n'
   (template
     (func
-      ('symbol', 'if')
+      (symbol 'if')
       (list
-        ('string', 't')
+        (string 't')
         (template
-          ('integer', '1'))))
-    ('string', '\n'))
+          (integer '1'))))
+    (string '\n'))
   one
   $ hg debugtemplate -D 1=one -v '{1|stringify}\n'
   (template
     (|
-      ('integer', '1')
-      ('symbol', 'stringify'))
-    ('string', '\n'))
+      (integer '1')
+      (symbol 'stringify'))
+    (string '\n'))
   one
 
 unless explicit symbol is expected:
@@ -3235,27 +3235,27 @@
 
   $ hg debugtemplate -Ra -r0 -v '{"string with no template fragment"}\n'
   (template
-    ('string', 'string with no template fragment')
-    ('string', '\n'))
+    (string 'string with no template fragment')
+    (string '\n'))
   string with no template fragment
   $ hg debugtemplate -Ra -r0 -v '{"template: {rev}"}\n'
   (template
     (template
-      ('string', 'template: ')
-      ('symbol', 'rev'))
-    ('string', '\n'))
+      (string 'template: ')
+      (symbol 'rev'))
+    (string '\n'))
   template: 0
   $ hg debugtemplate -Ra -r0 -v '{r"rawstring: {rev}"}\n'
   (template
-    ('string', 'rawstring: {rev}')
-    ('string', '\n'))
+    (string 'rawstring: {rev}')
+    (string '\n'))
   rawstring: {rev}
   $ hg debugtemplate -Ra -r0 -v '{files % r"rawstring: {file}"}\n'
   (template
     (%
-      ('symbol', 'files')
-      ('string', 'rawstring: {file}'))
-    ('string', '\n'))
+      (symbol 'files')
+      (string 'rawstring: {file}'))
+    (string '\n'))
   rawstring: {file}
 
 Test string escaping:
@@ -4242,49 +4242,49 @@
 
   $ hg debugtemplate -vr0 '{rn} {utcdate(date)|isodate}\n'
   (template
-    ('symbol', 'rn')
-    ('string', ' ')
+    (symbol 'rn')
+    (string ' ')
     (|
       (func
-        ('symbol', 'utcdate')
-        ('symbol', 'date'))
-      ('symbol', 'isodate'))
-    ('string', '\n'))
+        (symbol 'utcdate')
+        (symbol 'date'))
+      (symbol 'isodate'))
+    (string '\n'))
   * expanded:
   (template
     (template
-      ('symbol', 'rev')
-      ('string', ':')
+      (symbol 'rev')
+      (string ':')
       (|
-        ('symbol', 'node')
-        ('symbol', 'short')))
-    ('string', ' ')
+        (symbol 'node')
+        (symbol 'short')))
+    (string ' ')
     (|
       (func
-        ('symbol', 'localdate')
+        (symbol 'localdate')
         (list
-          ('symbol', 'date')
-          ('string', 'UTC')))
-      ('symbol', 'isodate'))
-    ('string', '\n'))
+          (symbol 'date')
+          (string 'UTC')))
+      (symbol 'isodate'))
+    (string '\n'))
   0:1e4e1b8f71e0 1970-01-12 13:46 +0000
 
   $ hg debugtemplate -vr0 '{status("A", file_adds)}'
   (template
     (func
-      ('symbol', 'status')
+      (symbol 'status')
       (list
-        ('string', 'A')
-        ('symbol', 'file_adds'))))
+        (string 'A')
+        (symbol 'file_adds'))))
   * expanded:
   (template
     (%
-      ('symbol', 'file_adds')
+      (symbol 'file_adds')
       (template
-        ('string', 'A')
-        ('string', ' ')
-        ('symbol', 'file')
-        ('string', '\n'))))
+        (string 'A')
+        (string ' ')
+        (symbol 'file')
+        (string '\n'))))
   A a
 
 A unary function alias can be called as a filter:
@@ -4293,20 +4293,20 @@
   (template
     (|
       (|
-        ('symbol', 'date')
-        ('symbol', 'utcdate'))
-      ('symbol', 'isodate'))
-    ('string', '\n'))
+        (symbol 'date')
+        (symbol 'utcdate'))
+      (symbol 'isodate'))
+    (string '\n'))
   * expanded:
   (template
     (|
       (func
-        ('symbol', 'localdate')
+        (symbol 'localdate')
         (list
-          ('symbol', 'date')
-          ('string', 'UTC')))
-      ('symbol', 'isodate'))
-    ('string', '\n'))
+          (symbol 'date')
+          (string 'UTC')))
+      (symbol 'isodate'))
+    (string '\n'))
   1970-01-12 13:46 +0000
 
 Aliases should be applied only to command arguments and templates in hgrc.
@@ -4341,7 +4341,7 @@
 
   $ hg debugtemplate --config templatealias.bad='x(' -v '{bad}'
   (template
-    ('symbol', 'bad'))
+    (symbol 'bad'))
   abort: bad definition of template alias "bad": at 2: not a prefix: end
   [255]
   $ hg log --config templatealias.bad='x(' -T '{bad}'
--- a/tests/test-fileset.t	Sun Sep 03 17:51:23 2017 +0900
+++ b/tests/test-fileset.t	Sun Sep 03 21:17:25 2017 +0900
@@ -17,20 +17,20 @@
 Test operators and basic patterns
 
   $ fileset -v a1
-  ('symbol', 'a1')
+  (symbol 'a1')
   a1
   $ fileset -v 'a*'
-  ('symbol', 'a*')
+  (symbol 'a*')
   a1
   a2
   $ fileset -v '"re:a\d"'
-  ('string', 're:a\\d')
+  (string 're:a\\d')
   a1
   a2
   $ fileset -v 'a1 or a2'
   (or
-    ('symbol', 'a1')
-    ('symbol', 'a2'))
+    (symbol 'a1')
+    (symbol 'a2'))
   a1
   a2
   $ fileset 'a1 | a2'
--- a/tests/test-glog.t	Sun Sep 03 17:51:23 2017 +0900
+++ b/tests/test-glog.t	Sun Sep 03 21:17:25 2017 +0900
@@ -1463,11 +1463,11 @@
       (or
         (list
           (func
-            ('symbol', 'user')
-            ('string', 'test'))
+            (symbol 'user')
+            (string 'test'))
           (func
-            ('symbol', 'user')
-            ('string', 'not-a-user'))))))
+            (symbol 'user')
+            (string 'not-a-user'))))))
   $ testlog -b not-a-branch
   abort: unknown revision 'not-a-branch'!
   abort: unknown revision 'not-a-branch'!
@@ -1479,14 +1479,14 @@
       (or
         (list
           (func
-            ('symbol', 'branch')
-            ('string', 'default'))
+            (symbol 'branch')
+            (string 'default'))
           (func
-            ('symbol', 'branch')
-            ('string', 'branch'))
+            (symbol 'branch')
+            (string 'branch'))
           (func
-            ('symbol', 'branch')
-            ('string', 'branch'))))))
+            (symbol 'branch')
+            (string 'branch'))))))
   $ testlog -k expand -k merge
   []
   (group
@@ -1494,30 +1494,30 @@
       (or
         (list
           (func
-            ('symbol', 'keyword')
-            ('string', 'expand'))
+            (symbol 'keyword')
+            (string 'expand'))
           (func
-            ('symbol', 'keyword')
-            ('string', 'merge'))))))
+            (symbol 'keyword')
+            (string 'merge'))))))
   $ testlog --only-merges
   []
   (group
     (func
-      ('symbol', 'merge')
+      (symbol 'merge')
       None))
   $ testlog --no-merges
   []
   (group
     (not
       (func
-        ('symbol', 'merge')
+        (symbol 'merge')
         None)))
   $ testlog --date '2 0 to 4 0'
   []
   (group
     (func
-      ('symbol', 'date')
-      ('string', '2 0 to 4 0')))
+      (symbol 'date')
+      (string '2 0 to 4 0')))
   $ hg log -G -d 'brace ) in a date'
   hg: parse error: invalid date: 'brace ) in a date'
   [255]
@@ -1530,18 +1530,18 @@
           (group
             (or
               (list
-                ('string', '31')
+                (string '31')
                 (func
-                  ('symbol', 'ancestors')
-                  ('string', '31'))))))
+                  (symbol 'ancestors')
+                  (string '31'))))))
         (not
           (group
             (or
               (list
-                ('string', '32')
+                (string '32')
                 (func
-                  ('symbol', 'ancestors')
-                  ('string', '32')))))))))
+                  (symbol 'ancestors')
+                  (string '32')))))))))
 
 Dedicated repo for --follow and paths filtering. The g is crafted to
 have 2 filelog topological heads in a linear changeset graph.
@@ -1591,8 +1591,8 @@
   (group
     (group
       (func
-        ('symbol', 'filelog')
-        ('string', 'a'))))
+        (symbol 'filelog')
+        (string 'a'))))
   $ testlog a b
   []
   (group
@@ -1600,11 +1600,11 @@
       (or
         (list
           (func
-            ('symbol', 'filelog')
-            ('string', 'a'))
+            (symbol 'filelog')
+            (string 'a'))
           (func
-            ('symbol', 'filelog')
-            ('string', 'b'))))))
+            (symbol 'filelog')
+            (string 'b'))))))
 
 Test falling back to slow path for non-existing files
 
@@ -1612,12 +1612,12 @@
   []
   (group
     (func
-      ('symbol', '_matchfiles')
+      (symbol '_matchfiles')
       (list
-        ('string', 'r:')
-        ('string', 'd:relpath')
-        ('string', 'p:a')
-        ('string', 'p:c'))))
+        (string 'r:')
+        (string 'd:relpath')
+        (string 'p:a')
+        (string 'p:c'))))
 
 Test multiple --include/--exclude/paths
 
@@ -1625,16 +1625,16 @@
   []
   (group
     (func
-      ('symbol', '_matchfiles')
+      (symbol '_matchfiles')
       (list
-        ('string', 'r:')
-        ('string', 'd:relpath')
-        ('string', 'p:a')
-        ('string', 'p:e')
-        ('string', 'i:a')
-        ('string', 'i:e')
-        ('string', 'x:b')
-        ('string', 'x:e'))))
+        (string 'r:')
+        (string 'd:relpath')
+        (string 'p:a')
+        (string 'p:e')
+        (string 'i:a')
+        (string 'i:e')
+        (string 'x:b')
+        (string 'x:e'))))
 
 Test glob expansion of pats
 
@@ -1649,8 +1649,8 @@
   (group
     (group
       (func
-        ('symbol', 'filelog')
-        ('string', 'aa'))))
+        (symbol 'filelog')
+        (string 'aa'))))
 
 Test --follow on a non-existent directory
 
@@ -1667,14 +1667,14 @@
   (group
     (and
       (func
-        ('symbol', 'ancestors')
-        ('symbol', '.'))
+        (symbol 'ancestors')
+        (symbol '.'))
       (func
-        ('symbol', '_matchfiles')
+        (symbol '_matchfiles')
         (list
-          ('string', 'r:')
-          ('string', 'd:relpath')
-          ('string', 'p:dir')))))
+          (string 'r:')
+          (string 'd:relpath')
+          (string 'p:dir')))))
   $ hg up -q tip
 
 Test --follow on file not in parent revision
@@ -1691,14 +1691,14 @@
   (group
     (and
       (func
-        ('symbol', 'ancestors')
-        ('symbol', '.'))
+        (symbol 'ancestors')
+        (symbol '.'))
       (func
-        ('symbol', '_matchfiles')
+        (symbol '_matchfiles')
         (list
-          ('string', 'r:')
-          ('string', 'd:relpath')
-          ('string', 'p:glob:*')))))
+          (string 'r:')
+          (string 'd:relpath')
+          (string 'p:glob:*')))))
 
 Test --follow on a single rename
 
@@ -1708,8 +1708,8 @@
   (group
     (group
       (func
-        ('symbol', 'follow')
-        ('string', 'a'))))
+        (symbol 'follow')
+        (string 'a'))))
 
 Test --follow and multiple renames
 
@@ -1719,8 +1719,8 @@
   (group
     (group
       (func
-        ('symbol', 'follow')
-        ('string', 'e'))))
+        (symbol 'follow')
+        (string 'e'))))
 
 Test --follow and multiple filelog heads
 
@@ -1730,8 +1730,8 @@
   (group
     (group
       (func
-        ('symbol', 'follow')
-        ('string', 'g'))))
+        (symbol 'follow')
+        (string 'g'))))
   $ cat log.nodes
   nodetag 2
   nodetag 1
@@ -1742,8 +1742,8 @@
   (group
     (group
       (func
-        ('symbol', 'follow')
-        ('string', 'g'))))
+        (symbol 'follow')
+        (string 'g'))))
   $ cat log.nodes
   nodetag 3
   nodetag 2
@@ -1758,11 +1758,11 @@
       (or
         (list
           (func
-            ('symbol', 'follow')
-            ('string', 'g'))
+            (symbol 'follow')
+            (string 'g'))
           (func
-            ('symbol', 'follow')
-            ('string', 'e'))))))
+            (symbol 'follow')
+            (string 'e'))))))
   $ cat log.nodes
   nodetag 4
   nodetag 3
@@ -1792,10 +1792,10 @@
   []
   (group
     (func
-      ('symbol', '_firstancestors')
+      (symbol '_firstancestors')
       (func
-        ('symbol', 'rev')
-        ('symbol', '6'))))
+        (symbol 'rev')
+        (symbol '6'))))
 
 Cannot compare with log --follow-first FILE as it never worked
 
@@ -1804,8 +1804,8 @@
   (group
     (group
       (func
-        ('symbol', '_followfirst')
-        ('string', 'e'))))
+        (symbol '_followfirst')
+        (string 'e'))))
   $ hg log -G --follow-first e --template '{rev} {desc|firstline}\n'
   @    6 merge 5 and 4
   |\
@@ -1839,20 +1839,20 @@
   []
   (group
     (func
-      ('symbol', '_matchfiles')
+      (symbol '_matchfiles')
       (list
-        ('string', 'r:')
-        ('string', 'd:relpath')
-        ('string', 'p:set:copied()'))))
+        (string 'r:')
+        (string 'd:relpath')
+        (string 'p:set:copied()'))))
   $ testlog --include "set:copied()"
   []
   (group
     (func
-      ('symbol', '_matchfiles')
+      (symbol '_matchfiles')
       (list
-        ('string', 'r:')
-        ('string', 'd:relpath')
-        ('string', 'i:set:copied()'))))
+        (string 'r:')
+        (string 'd:relpath')
+        (string 'i:set:copied()'))))
   $ testlog -r "sort(file('set:copied()'), -rev)"
   ["sort(file('set:copied()'), -rev)"]
   []
@@ -1866,24 +1866,24 @@
   []
   (group
     (func
-      ('symbol', '_matchfiles')
+      (symbol '_matchfiles')
       (list
-        ('string', 'r:')
-        ('string', 'd:relpath')
-        ('string', 'p:a'))))
+        (string 'r:')
+        (string 'd:relpath')
+        (string 'p:a'))))
   $ testlog --removed --follow a
   []
   (group
     (and
       (func
-        ('symbol', 'ancestors')
-        ('symbol', '.'))
+        (symbol 'ancestors')
+        (symbol '.'))
       (func
-        ('symbol', '_matchfiles')
+        (symbol '_matchfiles')
         (list
-          ('string', 'r:')
-          ('string', 'd:relpath')
-          ('string', 'p:a')))))
+          (string 'r:')
+          (string 'd:relpath')
+          (string 'p:a')))))
 
 Test --patch and --stat with --follow and --follow-first
 
@@ -2209,10 +2209,10 @@
   ['6', '8', '5', '7', '4']
   (group
     (func
-      ('symbol', 'descendants')
+      (symbol 'descendants')
       (func
-        ('symbol', 'rev')
-        ('symbol', '6'))))
+        (symbol 'rev')
+        (symbol '6'))))
 
 Test --follow-first and forward --rev
 
@@ -2220,10 +2220,10 @@
   ['6', '8', '5', '7', '4']
   (group
     (func
-      ('symbol', '_firstdescendants')
+      (symbol '_firstdescendants')
       (func
-        ('symbol', 'rev')
-        ('symbol', '6'))))
+        (symbol 'rev')
+        (symbol '6'))))
   --- log.nodes	* (glob)
   +++ glog.nodes	* (glob)
   @@ -1,3 +1,3 @@
@@ -2238,10 +2238,10 @@
   ['6', '5', '7', '8', '4']
   (group
     (func
-      ('symbol', 'ancestors')
+      (symbol 'ancestors')
       (func
-        ('symbol', 'rev')
-        ('symbol', '6'))))
+        (symbol 'rev')
+        (symbol '6'))))
 
 Test --follow-first and backward --rev
 
@@ -2249,10 +2249,10 @@
   ['6', '5', '7', '8', '4']
   (group
     (func
-      ('symbol', '_firstancestors')
+      (symbol '_firstancestors')
       (func
-        ('symbol', 'rev')
-        ('symbol', '6'))))
+        (symbol 'rev')
+        (symbol '6'))))
 
 Test --follow with --rev of graphlog extension
 
@@ -2270,25 +2270,25 @@
   []
   (group
     (func
-      ('symbol', '_matchfiles')
+      (symbol '_matchfiles')
       (list
-        ('string', 'r:')
-        ('string', 'd:relpath')
-        ('string', 'p:.'))))
+        (string 'r:')
+        (string 'd:relpath')
+        (string 'p:.'))))
   $ testlog ../b
   []
   (group
     (group
       (func
-        ('symbol', 'filelog')
-        ('string', '../b'))))
+        (symbol 'filelog')
+        (string '../b'))))
   $ testlog -f ../b
   []
   (group
     (group
       (func
-        ('symbol', 'follow')
-        ('string', 'b'))))
+        (symbol 'follow')
+        (string 'b'))))
   $ cd ..
 
 Test --hidden
--- a/tests/test-revset-dirstate-parents.t	Sun Sep 03 17:51:23 2017 +0900
+++ b/tests/test-revset-dirstate-parents.t	Sun Sep 03 21:17:25 2017 +0900
@@ -14,19 +14,19 @@
 
   $ try 'p1()'
   (func
-    ('symbol', 'p1')
+    (symbol 'p1')
     None)
   * set:
   <baseset []>
   $ try 'p2()'
   (func
-    ('symbol', 'p2')
+    (symbol 'p2')
     None)
   * set:
   <baseset []>
   $ try 'parents()'
   (func
-    ('symbol', 'parents')
+    (symbol 'parents')
     None)
   * set:
   <baseset+ []>
--- a/tests/test-revset.t	Sun Sep 03 17:51:23 2017 +0900
+++ b/tests/test-revset.t	Sun Sep 03 21:17:25 2017 +0900
@@ -155,8 +155,8 @@
 
   $ try 0:1
   (range
-    ('symbol', '0')
-    ('symbol', '1'))
+    (symbol '0')
+    (symbol '1'))
   * set:
   <spanset+ 0:2>
   0
@@ -181,8 +181,8 @@
   9
   $ try 3::6
   (dagrange
-    ('symbol', '3')
-    ('symbol', '6'))
+    (symbol '3')
+    (symbol '6'))
   * set:
   <baseset+ [3, 5, 6]>
   3
@@ -191,9 +191,9 @@
   $ try '0|1|2'
   (or
     (list
-      ('symbol', '0')
-      ('symbol', '1')
-      ('symbol', '2')))
+      (symbol '0')
+      (symbol '1')
+      (symbol '2')))
   * set:
   <baseset [0, 1, 2]>
   0
@@ -203,14 +203,14 @@
 names that should work without quoting
 
   $ try a
-  ('symbol', 'a')
+  (symbol 'a')
   * set:
   <baseset [0]>
   0
   $ try b-a
   (minus
-    ('symbol', 'b')
-    ('symbol', 'a'))
+    (symbol 'b')
+    (symbol 'a'))
   * set:
   <filteredset
     <baseset [1]>,
@@ -218,14 +218,14 @@
       <baseset [0]>>>
   1
   $ try _a_b_c_
-  ('symbol', '_a_b_c_')
+  (symbol '_a_b_c_')
   * set:
   <baseset [6]>
   6
   $ try _a_b_c_-a
   (minus
-    ('symbol', '_a_b_c_')
-    ('symbol', 'a'))
+    (symbol '_a_b_c_')
+    (symbol 'a'))
   * set:
   <filteredset
     <baseset [6]>,
@@ -233,14 +233,14 @@
       <baseset [0]>>>
   6
   $ try .a.b.c.
-  ('symbol', '.a.b.c.')
+  (symbol '.a.b.c.')
   * set:
   <baseset [7]>
   7
   $ try .a.b.c.-a
   (minus
-    ('symbol', '.a.b.c.')
-    ('symbol', 'a'))
+    (symbol '.a.b.c.')
+    (symbol 'a'))
   * set:
   <filteredset
     <baseset [7]>,
@@ -251,20 +251,20 @@
 names that should be caught by fallback mechanism
 
   $ try -- '-a-b-c-'
-  ('symbol', '-a-b-c-')
+  (symbol '-a-b-c-')
   * set:
   <baseset [4]>
   4
   $ log -a-b-c-
   4
   $ try '+a+b+c+'
-  ('symbol', '+a+b+c+')
+  (symbol '+a+b+c+')
   * set:
   <baseset [3]>
   3
   $ try '+a+b+c+:'
   (rangepost
-    ('symbol', '+a+b+c+'))
+    (symbol '+a+b+c+'))
   * set:
   <spanset+ 3:10>
   3
@@ -276,7 +276,7 @@
   9
   $ try ':+a+b+c+'
   (rangepre
-    ('symbol', '+a+b+c+'))
+    (symbol '+a+b+c+'))
   * set:
   <spanset+ 0:4>
   0
@@ -285,8 +285,8 @@
   3
   $ try -- '-a-b-c-:+a+b+c+'
   (range
-    ('symbol', '-a-b-c-')
-    ('symbol', '+a+b+c+'))
+    (symbol '-a-b-c-')
+    (symbol '+a+b+c+'))
   * set:
   <spanset- 3:5>
   4
@@ -300,15 +300,15 @@
     (minus
       (minus
         (negate
-          ('symbol', 'a'))
-        ('symbol', 'b'))
-      ('symbol', 'c'))
+          (symbol 'a'))
+        (symbol 'b'))
+      (symbol 'c'))
     (negate
-      ('symbol', 'a')))
+      (symbol 'a')))
   abort: unknown revision '-a'!
   [255]
   $ try é
-  ('symbol', '\xc3\xa9')
+  (symbol '\xc3\xa9')
   * set:
   <baseset [9]>
   9
@@ -324,8 +324,8 @@
 
   $ try '"-a-b-c-"-a'
   (minus
-    ('string', '-a-b-c-')
-    ('symbol', 'a'))
+    (string '-a-b-c-')
+    (symbol 'a'))
   * set:
   <filteredset
     <baseset [4]>,
@@ -345,9 +345,9 @@
   (or
     (list
       (and
-        ('symbol', '1')
-        ('symbol', '2'))
-      ('symbol', '3')))
+        (symbol '1')
+        (symbol '2'))
+      (symbol '3')))
   * set:
   <addset
     <baseset []>,
@@ -356,10 +356,10 @@
   $ try '1|2&3'
   (or
     (list
-      ('symbol', '1')
+      (symbol '1')
       (and
-        ('symbol', '2')
-        ('symbol', '3'))))
+        (symbol '2')
+        (symbol '3'))))
   * set:
   <addset
     <baseset [1]>,
@@ -368,20 +368,20 @@
   $ try '1&2&3' # associativity
   (and
     (and
-      ('symbol', '1')
-      ('symbol', '2'))
-    ('symbol', '3'))
+      (symbol '1')
+      (symbol '2'))
+    (symbol '3'))
   * set:
   <baseset []>
   $ try '1|(2|3)'
   (or
     (list
-      ('symbol', '1')
+      (symbol '1')
       (group
         (or
           (list
-            ('symbol', '2')
-            ('symbol', '3'))))))
+            (symbol '2')
+            (symbol '3'))))))
   * set:
   <addset
     <baseset [1]>,
@@ -471,11 +471,11 @@
 
   $ try 'foo=bar|baz'
   (keyvalue
-    ('symbol', 'foo')
+    (symbol 'foo')
     (or
       (list
-        ('symbol', 'bar')
-        ('symbol', 'baz'))))
+        (symbol 'bar')
+        (symbol 'baz'))))
   hg: parse error: can't use a key-value pair in this context
   [255]
 
@@ -483,17 +483,17 @@
 
   $ try --optimize 'foo=(not public())'
   (keyvalue
-    ('symbol', 'foo')
+    (symbol 'foo')
     (group
       (not
         (func
-          ('symbol', 'public')
+          (symbol 'public')
           None))))
   * optimized:
   (keyvalue
-    ('symbol', 'foo')
+    (symbol 'foo')
     (func
-      ('symbol', '_notpublic')
+      (symbol '_notpublic')
       None))
   hg: parse error: can't use a key-value pair in this context
   [255]
@@ -503,13 +503,13 @@
   $ hg debugrevspec -p parsed 'tip:tip^#generations[-1]'
   * parsed:
   (range
-    ('symbol', 'tip')
+    (symbol 'tip')
     (relsubscript
       (parentpost
-        ('symbol', 'tip'))
-      ('symbol', 'generations')
+        (symbol 'tip'))
+      (symbol 'generations')
       (negate
-        ('symbol', '1'))))
+        (symbol '1'))))
   9
   8
   7
@@ -522,10 +522,10 @@
   (not
     (relsubscript
       (func
-        ('symbol', 'public')
+        (symbol 'public')
         None)
-      ('symbol', 'generations')
-      ('symbol', '0')))
+      (symbol 'generations')
+      (symbol '0')))
 
 left-hand side of relation-subscript operator should be optimized recursively:
 
@@ -535,34 +535,34 @@
   (relsubscript
     (not
       (func
-        ('symbol', 'public')
+        (symbol 'public')
         None))
-    ('symbol', 'generations')
-    ('symbol', '0'))
+    (symbol 'generations')
+    (symbol '0'))
   * optimized:
   (relsubscript
     (func
-      ('symbol', '_notpublic')
+      (symbol '_notpublic')
       None)
-    ('symbol', 'generations')
-    ('symbol', '0'))
+    (symbol 'generations')
+    (symbol '0'))
 
 resolution of subscript and relation-subscript ternary operators:
 
   $ hg debugrevspec -p analyzed 'tip[0]'
   * analyzed:
   (subscript
-    ('symbol', 'tip')
-    ('symbol', '0'))
+    (symbol 'tip')
+    (symbol '0'))
   hg: parse error: can't use a subscript in this context
   [255]
 
   $ hg debugrevspec -p analyzed 'tip#rel[0]'
   * analyzed:
   (relsubscript
-    ('symbol', 'tip')
-    ('symbol', 'rel')
-    ('symbol', '0'))
+    (symbol 'tip')
+    (symbol 'rel')
+    (symbol '0'))
   hg: parse error: unknown identifier: rel
   [255]
 
@@ -570,9 +570,9 @@
   * analyzed:
   (subscript
     (relation
-      ('symbol', 'tip')
-      ('symbol', 'rel'))
-    ('symbol', '0'))
+      (symbol 'tip')
+      (symbol 'rel'))
+    (symbol '0'))
   hg: parse error: can't use a subscript in this context
   [255]
 
@@ -580,10 +580,10 @@
   * analyzed:
   (subscript
     (relsubscript
-      ('symbol', 'tip')
-      ('symbol', 'rel')
-      ('symbol', '0'))
-    ('symbol', '1'))
+      (symbol 'tip')
+      (symbol 'rel')
+      (symbol '0'))
+    (symbol '1'))
   hg: parse error: can't use a subscript in this context
   [255]
 
@@ -591,10 +591,10 @@
   * analyzed:
   (relsubscript
     (relation
-      ('symbol', 'tip')
-      ('symbol', 'rel0'))
-    ('symbol', 'rel1')
-    ('symbol', '1'))
+      (symbol 'tip')
+      (symbol 'rel0'))
+    (symbol 'rel1')
+    (symbol '1'))
   hg: parse error: unknown identifier: rel1
   [255]
 
@@ -602,11 +602,11 @@
   * analyzed:
   (relsubscript
     (relsubscript
-      ('symbol', 'tip')
-      ('symbol', 'rel0')
-      ('symbol', '0'))
-    ('symbol', 'rel1')
-    ('symbol', '1'))
+      (symbol 'tip')
+      (symbol 'rel0')
+      (symbol '0'))
+    (symbol 'rel1')
+    (symbol '1'))
   hg: parse error: unknown identifier: rel1
   [255]
 
@@ -675,23 +675,23 @@
     (group
       (or
         (list
-          ('symbol', '0')
-          ('symbol', '1'))))
-    ('symbol', '1'))
+          (symbol '0')
+          (symbol '1'))))
+    (symbol '1'))
   * analyzed:
   (and
     (or
       (list
-        ('symbol', '0')
-        ('symbol', '1')))
+        (symbol '0')
+        (symbol '1')))
     (not
-      ('symbol', '1')))
+      (symbol '1')))
   * optimized:
   (difference
     (func
-      ('symbol', '_list')
-      ('string', '0\x001'))
-    ('symbol', '1'))
+      (symbol '_list')
+      (string '0\x001'))
+    (symbol '1'))
   0
 
   $ hg debugrevspec -p unknown '0'
@@ -710,15 +710,15 @@
   * analyzed:
   (and
     (func
-      ('symbol', 'r3232')
+      (symbol 'r3232')
       None)
-    ('symbol', '2'))
+    (symbol '2'))
   * optimized:
   (andsmally
     (func
-      ('symbol', 'r3232')
+      (symbol 'r3232')
       None)
-    ('symbol', '2'))
+    (symbol '2'))
   * analyzed set:
   <baseset [2]>
   * optimized set:
@@ -766,7 +766,7 @@
   $ try -p analyzed ':1'
   * analyzed:
   (rangepre
-    ('symbol', '1'))
+    (symbol '1'))
   * set:
   <spanset+ 0:2>
   0
@@ -776,8 +776,8 @@
   (rangepre
     (or
       (list
-        ('symbol', '1')
-        ('symbol', '2'))))
+        (symbol '1')
+        (symbol '2'))))
   * set:
   <spanset+ 0:3>
   0
@@ -787,8 +787,8 @@
   * analyzed:
   (rangepre
     (and
-      ('symbol', '1')
-      ('symbol', '2')))
+      (symbol '1')
+      (symbol '2')))
   * set:
   <baseset []>
 
@@ -799,8 +799,8 @@
   $ try '1^:2'
   (range
     (parentpost
-      ('symbol', '1'))
-    ('symbol', '2'))
+      (symbol '1'))
+    (symbol '2'))
   * set:
   <spanset+ 0:3>
   0
@@ -810,8 +810,8 @@
   $ try '1^::2'
   (dagrange
     (parentpost
-      ('symbol', '1'))
-    ('symbol', '2'))
+      (symbol '1'))
+    (symbol '2'))
   * set:
   <baseset+ [0, 1, 2]>
   0
@@ -821,7 +821,7 @@
   $ try '9^:'
   (rangepost
     (parentpost
-      ('symbol', '9')))
+      (symbol '9')))
   * set:
   <spanset+ 8:10>
   8
@@ -831,10 +831,10 @@
 
   $ try '1^(:2)'
   (parent
-    ('symbol', '1')
+    (symbol '1')
     (group
       (rangepre
-        ('symbol', '2'))))
+        (symbol '2'))))
   hg: parse error: ^ expects a number 0, 1, or 2
   [255]
 
@@ -842,11 +842,11 @@
 
   $ try 'sort(1^:2)'
   (func
-    ('symbol', 'sort')
+    (symbol 'sort')
     (range
       (parentpost
-        ('symbol', '1'))
-      ('symbol', '2')))
+        (symbol '1'))
+      (symbol '2')))
   * set:
   <spanset+ 0:3>
   0
@@ -859,9 +859,9 @@
       (group
         (range
           (parentpost
-            ('symbol', '3'))
-          ('symbol', '4'))))
-    ('symbol', '2'))
+            (symbol '3'))
+          (symbol '4'))))
+    (symbol '2'))
   * set:
   <spanset+ 0:3>
   0
@@ -874,9 +874,9 @@
       (group
         (dagrange
           (parentpost
-            ('symbol', '3'))
-          ('symbol', '4'))))
-    ('symbol', '2'))
+            (symbol '3'))
+          (symbol '4'))))
+    (symbol '2'))
   * set:
   <baseset+ [0, 1, 2]>
   0
@@ -889,7 +889,7 @@
       (group
         (rangepost
           (parentpost
-            ('symbol', '9'))))))
+            (symbol '9'))))))
   * set:
   <spanset+ 4:10>
   4
@@ -902,12 +902,12 @@
  x^ in alias should also be resolved
 
   $ try 'A' --config 'revsetalias.A=1^:2'
-  ('symbol', 'A')
+  (symbol 'A')
   * expanded:
   (range
     (parentpost
-      ('symbol', '1'))
-    ('symbol', '2'))
+      (symbol '1'))
+    (symbol '2'))
   * set:
   <spanset+ 0:3>
   0
@@ -916,13 +916,13 @@
 
   $ try 'A:2' --config 'revsetalias.A=1^'
   (range
-    ('symbol', 'A')
-    ('symbol', '2'))
+    (symbol 'A')
+    (symbol '2'))
   * expanded:
   (range
     (parentpost
-      ('symbol', '1'))
-    ('symbol', '2'))
+      (symbol '1'))
+    (symbol '2'))
   * set:
   <spanset+ 0:3>
   0
@@ -934,13 +934,13 @@
 
   $ try '1^A' --config 'revsetalias.A=:2'
   (parent
-    ('symbol', '1')
-    ('symbol', 'A'))
+    (symbol '1')
+    (symbol 'A'))
   * expanded:
   (parent
-    ('symbol', '1')
+    (symbol '1')
     (rangepre
-      ('symbol', '2')))
+      (symbol '2')))
   hg: parse error: ^ expects a number 0, 1, or 2
   [255]
 
@@ -1168,11 +1168,11 @@
   * parsed:
   (relsubscript
     (func
-      ('symbol', 'roots')
+      (symbol 'roots')
       (rangeall
         None))
-    ('symbol', 'g')
-    ('symbol', '2'))
+    (symbol 'g')
+    (symbol '2'))
   2
   3
 
@@ -1270,22 +1270,22 @@
   6
   $ try 'grep("(")' # invalid regular expression
   (func
-    ('symbol', 'grep')
-    ('string', '('))
+    (symbol 'grep')
+    (string '('))
   hg: parse error: invalid match pattern: unbalanced parenthesis
   [255]
   $ try 'grep("\bissue\d+")'
   (func
-    ('symbol', 'grep')
-    ('string', '\x08issue\\d+'))
+    (symbol 'grep')
+    (string '\x08issue\\d+'))
   * set:
   <filteredset
     <fullreposet+ 0:10>,
     <grep '\x08issue\\d+'>>
   $ try 'grep(r"\bissue\d+")'
   (func
-    ('symbol', 'grep')
-    ('string', '\\bissue\\d+'))
+    (symbol 'grep')
+    (string '\\bissue\\d+'))
   * set:
   <filteredset
     <fullreposet+ 0:10>,
@@ -1602,17 +1602,17 @@
   (onlypost
     (minus
       (range
-        ('symbol', '8')
-        ('symbol', '9'))
-      ('symbol', '8')))
+        (symbol '8')
+        (symbol '9'))
+      (symbol '8')))
   * optimized:
   (func
-    ('symbol', 'only')
+    (symbol 'only')
     (difference
       (range
-        ('symbol', '8')
-        ('symbol', '9'))
-      ('symbol', '8')))
+        (symbol '8')
+        (symbol '9'))
+      (symbol '8')))
   * set:
   <baseset+ [8, 9]>
   8
@@ -1620,15 +1620,15 @@
   $ try --optimize '(9)%(5)'
   (only
     (group
-      ('symbol', '9'))
+      (symbol '9'))
     (group
-      ('symbol', '5')))
+      (symbol '5')))
   * optimized:
   (func
-    ('symbol', 'only')
+    (symbol 'only')
     (list
-      ('symbol', '9')
-      ('symbol', '5')))
+      (symbol '9')
+      (symbol '5')))
   * set:
   <baseset+ [2, 4, 8, 9]>
   2
@@ -1962,14 +1962,14 @@
   (difference
     (and
       (range
-        ('symbol', '3')
-        ('symbol', '0'))
+        (symbol '3')
+        (symbol '0'))
       (range
-        ('symbol', '0')
-        ('symbol', '3')))
+        (symbol '0')
+        (symbol '3')))
     (range
-      ('symbol', '2')
-      ('symbol', '1')))
+      (symbol '2')
+      (symbol '1')))
   * set:
   <filteredset
     <filteredset
@@ -1986,22 +1986,22 @@
   $ try --optimize '2:0 & (0 + 1 + 2)'
   (and
     (range
-      ('symbol', '2')
-      ('symbol', '0'))
+      (symbol '2')
+      (symbol '0'))
     (group
       (or
         (list
-          ('symbol', '0')
-          ('symbol', '1')
-          ('symbol', '2')))))
+          (symbol '0')
+          (symbol '1')
+          (symbol '2')))))
   * optimized:
   (and
     (range
-      ('symbol', '2')
-      ('symbol', '0'))
+      (symbol '2')
+      (symbol '0'))
     (func
-      ('symbol', '_list')
-      ('string', '0\x001\x002')))
+      (symbol '_list')
+      (string '0\x001\x002')))
   * set:
   <filteredset
     <spanset- 0:3>,
@@ -2015,26 +2015,26 @@
   $ try --optimize '2:0 & (0:1 + 2)'
   (and
     (range
-      ('symbol', '2')
-      ('symbol', '0'))
+      (symbol '2')
+      (symbol '0'))
     (group
       (or
         (list
           (range
-            ('symbol', '0')
-            ('symbol', '1'))
-          ('symbol', '2')))))
+            (symbol '0')
+            (symbol '1'))
+          (symbol '2')))))
   * optimized:
   (and
     (range
-      ('symbol', '2')
-      ('symbol', '0'))
+      (symbol '2')
+      (symbol '0'))
     (or
       (list
         (range
-          ('symbol', '0')
-          ('symbol', '1'))
-        ('symbol', '2'))))
+          (symbol '0')
+          (symbol '1'))
+        (symbol '2'))))
   * set:
   <filteredset
     <spanset- 0:3>,
@@ -2050,19 +2050,19 @@
   $ trylist --optimize '2:0 & %ld' 0 1 2
   (and
     (range
-      ('symbol', '2')
-      ('symbol', '0'))
+      (symbol '2')
+      (symbol '0'))
     (func
-      ('symbol', '_intlist')
-      ('string', '0\x001\x002')))
+      (symbol '_intlist')
+      (string '0\x001\x002')))
   * optimized:
   (andsmally
     (range
-      ('symbol', '2')
-      ('symbol', '0'))
+      (symbol '2')
+      (symbol '0'))
     (func
-      ('symbol', '_intlist')
-      ('string', '0\x001\x002')))
+      (symbol '_intlist')
+      (string '0\x001\x002')))
   * set:
   <filteredset
     <spanset- 0:3>,
@@ -2074,19 +2074,19 @@
   $ trylist --optimize '%ld & 2:0' 0 2 1
   (and
     (func
-      ('symbol', '_intlist')
-      ('string', '0\x002\x001'))
+      (symbol '_intlist')
+      (string '0\x002\x001'))
     (range
-      ('symbol', '2')
-      ('symbol', '0')))
+      (symbol '2')
+      (symbol '0')))
   * optimized:
   (and
     (func
-      ('symbol', '_intlist')
-      ('string', '0\x002\x001'))
+      (symbol '_intlist')
+      (string '0\x002\x001'))
     (range
-      ('symbol', '2')
-      ('symbol', '0')))
+      (symbol '2')
+      (symbol '0')))
   * set:
   <filteredset
     <baseset [0, 2, 1]>,
@@ -2100,19 +2100,19 @@
   $ trylist --optimize --bin '2:0 & %ln' `hg log -T '{node} ' -r0:2`
   (and
     (range
-      ('symbol', '2')
-      ('symbol', '0'))
+      (symbol '2')
+      (symbol '0'))
     (func
-      ('symbol', '_hexlist')
-      ('string', '*'))) (glob)
+      (symbol '_hexlist')
+      (string '*'))) (glob)
   * optimized:
   (and
     (range
-      ('symbol', '2')
-      ('symbol', '0'))
+      (symbol '2')
+      (symbol '0'))
     (func
-      ('symbol', '_hexlist')
-      ('string', '*'))) (glob)
+      (symbol '_hexlist')
+      (string '*'))) (glob)
   * set:
   <filteredset
     <spanset- 0:3>,
@@ -2124,19 +2124,19 @@
   $ trylist --optimize --bin '%ln & 2:0' `hg log -T '{node} ' -r0+2+1`
   (and
     (func
-      ('symbol', '_hexlist')
-      ('string', '*')) (glob)
+      (symbol '_hexlist')
+      (string '*')) (glob)
     (range
-      ('symbol', '2')
-      ('symbol', '0')))
+      (symbol '2')
+      (symbol '0')))
   * optimized:
   (andsmally
     (func
-      ('symbol', '_hexlist')
-      ('string', '*')) (glob)
+      (symbol '_hexlist')
+      (string '*')) (glob)
     (range
-      ('symbol', '2')
-      ('symbol', '0')))
+      (symbol '2')
+      (symbol '0')))
   * set:
   <baseset [0, 2, 1]>
   0
@@ -2150,11 +2150,11 @@
   * optimized:
   (difference
     (range
-      ('symbol', '2')
-      ('symbol', '0'))
+      (symbol '2')
+      (symbol '0'))
     (func
-      ('symbol', '_list')
-      ('string', '0\x001')))
+      (symbol '_list')
+      (string '0\x001')))
   * set:
   <filteredset
     <spanset- 0:3>,
@@ -2166,15 +2166,15 @@
   * optimized:
   (difference
     (range
-      ('symbol', '2')
-      ('symbol', '0'))
+      (symbol '2')
+      (symbol '0'))
     (and
       (range
-        ('symbol', '0')
-        ('symbol', '2'))
+        (symbol '0')
+        (symbol '2'))
       (func
-        ('symbol', '_list')
-        ('string', '0\x001'))))
+        (symbol '_list')
+        (string '0\x001'))))
   * set:
   <filteredset
     <spanset- 0:3>,
@@ -2188,10 +2188,10 @@
   $ try -p optimized 'present(2 + 0 + 1)'
   * optimized:
   (func
-    ('symbol', 'present')
+    (symbol 'present')
     (func
-      ('symbol', '_list')
-      ('string', '2\x000\x001')))
+      (symbol '_list')
+      (string '2\x000\x001')))
   * set:
   <baseset [2, 0, 1]>
   2
@@ -2201,25 +2201,25 @@
   $ try --optimize '2:0 & present(0 + 1 + 2)'
   (and
     (range
-      ('symbol', '2')
-      ('symbol', '0'))
+      (symbol '2')
+      (symbol '0'))
     (func
-      ('symbol', 'present')
+      (symbol 'present')
       (or
         (list
-          ('symbol', '0')
-          ('symbol', '1')
-          ('symbol', '2')))))
+          (symbol '0')
+          (symbol '1')
+          (symbol '2')))))
   * optimized:
   (and
     (range
-      ('symbol', '2')
-      ('symbol', '0'))
+      (symbol '2')
+      (symbol '0'))
     (func
-      ('symbol', 'present')
+      (symbol 'present')
       (func
-        ('symbol', '_list')
-        ('string', '0\x001\x002'))))
+        (symbol '_list')
+        (string '0\x001\x002'))))
   * set:
   <filteredset
     <spanset- 0:3>,
@@ -2233,22 +2233,22 @@
   $ try --optimize '0:2 & reverse(all())'
   (and
     (range
-      ('symbol', '0')
-      ('symbol', '2'))
+      (symbol '0')
+      (symbol '2'))
     (func
-      ('symbol', 'reverse')
+      (symbol 'reverse')
       (func
-        ('symbol', 'all')
+        (symbol 'all')
         None)))
   * optimized:
   (and
     (range
-      ('symbol', '0')
-      ('symbol', '2'))
+      (symbol '0')
+      (symbol '2'))
     (func
-      ('symbol', 'reverse')
+      (symbol 'reverse')
       (func
-        ('symbol', 'all')
+        (symbol 'all')
         None)))
   * set:
   <filteredset
@@ -2263,28 +2263,28 @@
   $ try --optimize '0:2 & sort(all(), -rev)'
   (and
     (range
-      ('symbol', '0')
-      ('symbol', '2'))
+      (symbol '0')
+      (symbol '2'))
     (func
-      ('symbol', 'sort')
+      (symbol 'sort')
       (list
         (func
-          ('symbol', 'all')
+          (symbol 'all')
           None)
         (negate
-          ('symbol', 'rev')))))
+          (symbol 'rev')))))
   * optimized:
   (and
     (range
-      ('symbol', '0')
-      ('symbol', '2'))
+      (symbol '0')
+      (symbol '2'))
     (func
-      ('symbol', 'sort')
+      (symbol 'sort')
       (list
         (func
-          ('symbol', 'all')
+          (symbol 'all')
           None)
-        ('string', '-rev'))))
+        (string '-rev'))))
   * set:
   <filteredset
     <spanset+ 0:3>,
@@ -2307,25 +2307,25 @@
   $ try --optimize '2:0 & first(1 + 0 + 2)'
   (and
     (range
-      ('symbol', '2')
-      ('symbol', '0'))
+      (symbol '2')
+      (symbol '0'))
     (func
-      ('symbol', 'first')
+      (symbol 'first')
       (or
         (list
-          ('symbol', '1')
-          ('symbol', '0')
-          ('symbol', '2')))))
+          (symbol '1')
+          (symbol '0')
+          (symbol '2')))))
   * optimized:
   (and
     (range
-      ('symbol', '2')
-      ('symbol', '0'))
+      (symbol '2')
+      (symbol '0'))
     (func
-      ('symbol', 'first')
+      (symbol 'first')
       (func
-        ('symbol', '_list')
-        ('string', '1\x000\x002'))))
+        (symbol '_list')
+        (string '1\x000\x002'))))
   * set:
   <filteredset
     <baseset [1]>,
@@ -2335,26 +2335,26 @@
   $ try --optimize '2:0 & not last(0 + 2 + 1)'
   (and
     (range
-      ('symbol', '2')
-      ('symbol', '0'))
+      (symbol '2')
+      (symbol '0'))
     (not
       (func
-        ('symbol', 'last')
+        (symbol 'last')
         (or
           (list
-            ('symbol', '0')
-            ('symbol', '2')
-            ('symbol', '1'))))))
+            (symbol '0')
+            (symbol '2')
+            (symbol '1'))))))
   * optimized:
   (difference
     (range
-      ('symbol', '2')
-      ('symbol', '0'))
+      (symbol '2')
+      (symbol '0'))
     (func
-      ('symbol', 'last')
+      (symbol 'last')
       (func
-        ('symbol', '_list')
-        ('string', '0\x002\x001'))))
+        (symbol '_list')
+        (string '0\x002\x001'))))
   * set:
   <filteredset
     <spanset- 0:3>,
@@ -2368,33 +2368,33 @@
   $ try --optimize '2:0 & (1 + 0 + 2):(0 + 2 + 1)'
   (and
     (range
-      ('symbol', '2')
-      ('symbol', '0'))
+      (symbol '2')
+      (symbol '0'))
     (range
       (group
         (or
           (list
-            ('symbol', '1')
-            ('symbol', '0')
-            ('symbol', '2'))))
+            (symbol '1')
+            (symbol '0')
+            (symbol '2'))))
       (group
         (or
           (list
-            ('symbol', '0')
-            ('symbol', '2')
-            ('symbol', '1'))))))
+            (symbol '0')
+            (symbol '2')
+            (symbol '1'))))))
   * optimized:
   (and
     (range
-      ('symbol', '2')
-      ('symbol', '0'))
+      (symbol '2')
+      (symbol '0'))
     (range
       (func
-        ('symbol', '_list')
-        ('string', '1\x000\x002'))
+        (symbol '_list')
+        (string '1\x000\x002'))
       (func
-        ('symbol', '_list')
-        ('string', '0\x002\x001'))))
+        (symbol '_list')
+        (string '0\x002\x001'))))
   * set:
   <filteredset
     <spanset- 0:3>,
@@ -2406,22 +2406,22 @@
   $ try --optimize 'contains("glob:*") & (2 + 0 + 1)'
   (and
     (func
-      ('symbol', 'contains')
-      ('string', 'glob:*'))
+      (symbol 'contains')
+      (string 'glob:*'))
     (group
       (or
         (list
-          ('symbol', '2')
-          ('symbol', '0')
-          ('symbol', '1')))))
+          (symbol '2')
+          (symbol '0')
+          (symbol '1')))))
   * optimized:
   (andsmally
     (func
-      ('symbol', 'contains')
-      ('string', 'glob:*'))
+      (symbol 'contains')
+      (string 'glob:*'))
     (func
-      ('symbol', '_list')
-      ('string', '2\x000\x001')))
+      (symbol '_list')
+      (string '2\x000\x001')))
   * set:
   <filteredset
     <baseset+ [0, 1, 2]>,
@@ -2436,26 +2436,26 @@
   $ try --optimize 'reverse(contains("glob:*")) & (0 + 2 + 1)'
   (and
     (func
-      ('symbol', 'reverse')
+      (symbol 'reverse')
       (func
-        ('symbol', 'contains')
-        ('string', 'glob:*')))
+        (symbol 'contains')
+        (string 'glob:*')))
     (group
       (or
         (list
-          ('symbol', '0')
-          ('symbol', '2')
-          ('symbol', '1')))))
+          (symbol '0')
+          (symbol '2')
+          (symbol '1')))))
   * optimized:
   (andsmally
     (func
-      ('symbol', 'reverse')
+      (symbol 'reverse')
       (func
-        ('symbol', 'contains')
-        ('string', 'glob:*')))
+        (symbol 'contains')
+        (string 'glob:*')))
     (func
-      ('symbol', '_list')
-      ('string', '0\x002\x001')))
+      (symbol '_list')
+      (string '0\x002\x001')))
   * set:
   <filteredset
     <baseset- [0, 1, 2]>,
@@ -2791,13 +2791,13 @@
   (or
     (list
       (func
-        ('symbol', 'reverse')
+        (symbol 'reverse')
         (dagrange
-          ('symbol', '1')
-          ('symbol', '5')))
+          (symbol '1')
+          (symbol '5')))
       (func
-        ('symbol', 'ancestors')
-        ('symbol', '4'))))
+        (symbol 'ancestors')
+        (symbol '4'))))
   * set:
   <addset
     <baseset- [1, 3, 5]>,
@@ -2810,17 +2810,17 @@
   4
   $ try 'sort(ancestors(4) or reverse(1::5))'
   (func
-    ('symbol', 'sort')
+    (symbol 'sort')
     (or
       (list
         (func
-          ('symbol', 'ancestors')
-          ('symbol', '4'))
+          (symbol 'ancestors')
+          (symbol '4'))
         (func
-          ('symbol', 'reverse')
+          (symbol 'reverse')
           (dagrange
-            ('symbol', '1')
-            ('symbol', '5'))))))
+            (symbol '1')
+            (symbol '5'))))))
   * set:
   <addset+
     <generatorset+>,
@@ -2837,18 +2837,18 @@
   $ try --optimize '0|(1)|"2"|-2|tip|null'
   (or
     (list
-      ('symbol', '0')
+      (symbol '0')
       (group
-        ('symbol', '1'))
-      ('string', '2')
+        (symbol '1'))
+      (string '2')
       (negate
-        ('symbol', '2'))
-      ('symbol', 'tip')
-      ('symbol', 'null')))
+        (symbol '2'))
+      (symbol 'tip')
+      (symbol 'null')))
   * optimized:
   (func
-    ('symbol', '_list')
-    ('string', '0\x001\x002\x00-2\x00tip\x00null'))
+    (symbol '_list')
+    (string '0\x001\x002\x00-2\x00tip\x00null'))
   * set:
   <baseset [0, 1, 2, 8, 9, -1]>
   0
@@ -2861,20 +2861,20 @@
   $ try --optimize '0|1|2:3'
   (or
     (list
-      ('symbol', '0')
-      ('symbol', '1')
+      (symbol '0')
+      (symbol '1')
       (range
-        ('symbol', '2')
-        ('symbol', '3'))))
+        (symbol '2')
+        (symbol '3'))))
   * optimized:
   (or
     (list
       (func
-        ('symbol', '_list')
-        ('string', '0\x001'))
+        (symbol '_list')
+        (string '0\x001'))
       (range
-        ('symbol', '2')
-        ('symbol', '3'))))
+        (symbol '2')
+        (symbol '3'))))
   * set:
   <addset
     <baseset [0, 1]>,
@@ -2888,27 +2888,27 @@
   (or
     (list
       (range
-        ('symbol', '0')
-        ('symbol', '1'))
-      ('symbol', '2')
+        (symbol '0')
+        (symbol '1'))
+      (symbol '2')
       (range
-        ('symbol', '3')
-        ('symbol', '4'))
-      ('symbol', '5')
-      ('symbol', '6')))
+        (symbol '3')
+        (symbol '4'))
+      (symbol '5')
+      (symbol '6')))
   * optimized:
   (or
     (list
       (range
-        ('symbol', '0')
-        ('symbol', '1'))
-      ('symbol', '2')
+        (symbol '0')
+        (symbol '1'))
+      (symbol '2')
       (range
-        ('symbol', '3')
-        ('symbol', '4'))
+        (symbol '3')
+        (symbol '4'))
       (func
-        ('symbol', '_list')
-        ('string', '5\x006'))))
+        (symbol '_list')
+        (string '5\x006'))))
   * set:
   <addset
     <addset
@@ -2931,11 +2931,11 @@
   * analyzed:
   (or
     (list
-      ('symbol', '0')
-      ('symbol', '1')
-      ('symbol', '2')
-      ('symbol', '3')
-      ('symbol', '4')))
+      (symbol '0')
+      (symbol '1')
+      (symbol '2')
+      (symbol '3')
+      (symbol '4')))
   * set:
   <addset
     <addset
@@ -2999,9 +2999,9 @@
   [255]
   $ try '0,1,2'
   (list
-    ('symbol', '0')
-    ('symbol', '1')
-    ('symbol', '2'))
+    (symbol '0')
+    (symbol '1')
+    (symbol '2'))
   hg: parse error: can't use a list in this context
   (see hg help "revsets.x or y")
   [255]
@@ -3012,20 +3012,20 @@
   (or
     (list
       (range
-        ('symbol', '0')
-        ('symbol', '1'))
+        (symbol '0')
+        (symbol '1'))
       (range
-        ('symbol', '1')
-        ('symbol', '2'))
+        (symbol '1')
+        (symbol '2'))
       (range
-        ('symbol', '2')
-        ('symbol', '3'))
+        (symbol '2')
+        (symbol '3'))
       (range
-        ('symbol', '3')
-        ('symbol', '4'))
+        (symbol '3')
+        (symbol '4'))
       (range
-        ('symbol', '4')
-        ('symbol', '5'))))
+        (symbol '4')
+        (symbol '5'))))
   * set:
   <addset
     <addset
@@ -3048,13 +3048,13 @@
   $ try --optimize '0|()'
   (or
     (list
-      ('symbol', '0')
+      (symbol '0')
       (group
         None)))
   * optimized:
   (or
     (list
-      ('symbol', '0')
+      (symbol '0')
       None))
   hg: parse error: missing argument
   [255]
@@ -3077,47 +3077,47 @@
   $ try --optimize '::3 - ::1'
   (minus
     (dagrangepre
-      ('symbol', '3'))
+      (symbol '3'))
     (dagrangepre
-      ('symbol', '1')))
+      (symbol '1')))
   * optimized:
   (func
-    ('symbol', 'only')
+    (symbol 'only')
     (list
-      ('symbol', '3')
-      ('symbol', '1')))
+      (symbol '3')
+      (symbol '1')))
   * set:
   <baseset+ [3]>
   3
   $ try --optimize 'ancestors(1) - ancestors(3)'
   (minus
     (func
-      ('symbol', 'ancestors')
-      ('symbol', '1'))
+      (symbol 'ancestors')
+      (symbol '1'))
     (func
-      ('symbol', 'ancestors')
-      ('symbol', '3')))
+      (symbol 'ancestors')
+      (symbol '3')))
   * optimized:
   (func
-    ('symbol', 'only')
+    (symbol 'only')
     (list
-      ('symbol', '1')
-      ('symbol', '3')))
+      (symbol '1')
+      (symbol '3')))
   * set:
   <baseset+ []>
   $ try --optimize 'not ::2 and ::6'
   (and
     (not
       (dagrangepre
-        ('symbol', '2')))
+        (symbol '2')))
     (dagrangepre
-      ('symbol', '6')))
+      (symbol '6')))
   * optimized:
   (func
-    ('symbol', 'only')
+    (symbol 'only')
     (list
-      ('symbol', '6')
-      ('symbol', '2')))
+      (symbol '6')
+      (symbol '2')))
   * set:
   <baseset+ [3, 4, 5, 6]>
   3
@@ -3127,18 +3127,18 @@
   $ try --optimize 'ancestors(6) and not ancestors(4)'
   (and
     (func
-      ('symbol', 'ancestors')
-      ('symbol', '6'))
+      (symbol 'ancestors')
+      (symbol '6'))
     (not
       (func
-        ('symbol', 'ancestors')
-        ('symbol', '4'))))
+        (symbol 'ancestors')
+        (symbol '4'))))
   * optimized:
   (func
-    ('symbol', 'only')
+    (symbol 'only')
     (list
-      ('symbol', '6')
-      ('symbol', '4')))
+      (symbol '6')
+      (symbol '4')))
   * set:
   <baseset+ [3, 5, 6]>
   3
@@ -3150,14 +3150,14 @@
   $ try --optimize '::1 and ()'
   (and
     (dagrangepre
-      ('symbol', '1'))
+      (symbol '1'))
     (group
       None))
   * optimized:
   (andsmally
     (func
-      ('symbol', 'ancestors')
-      ('symbol', '1'))
+      (symbol 'ancestors')
+      (symbol '1'))
     None)
   hg: parse error: missing argument
   [255]
@@ -3168,13 +3168,13 @@
   * optimized:
   (difference
     (func
-      ('symbol', 'ancestors')
-      ('symbol', '6'))
+      (symbol 'ancestors')
+      (symbol '6'))
     (func
-      ('symbol', 'ancestors')
+      (symbol 'ancestors')
       (list
-        ('symbol', '4')
-        ('symbol', '1'))))
+        (symbol '4')
+        (symbol '1'))))
   0
   1
   3
@@ -3184,13 +3184,13 @@
   * optimized:
   (difference
     (func
-      ('symbol', 'ancestors')
+      (symbol 'ancestors')
       (list
-        ('symbol', '6')
-        ('symbol', '1')))
+        (symbol '6')
+        (symbol '1')))
     (func
-      ('symbol', 'ancestors')
-      ('symbol', '4')))
+      (symbol 'ancestors')
+      (symbol '4')))
   5
   6
 
@@ -3201,15 +3201,15 @@
   * optimized:
   (difference
     (func
-      ('symbol', 'ancestors')
+      (symbol 'ancestors')
       (keyvalue
-        ('symbol', 'set')
-        ('symbol', '6')))
+        (symbol 'set')
+        (symbol '6')))
     (func
-      ('symbol', 'ancestors')
+      (symbol 'ancestors')
       (keyvalue
-        ('symbol', 'set')
-        ('symbol', '4'))))
+        (symbol 'set')
+        (symbol '4'))))
   3
   5
   6
@@ -3492,10 +3492,10 @@
   $ echo 'rs4(ARG1, ARGA, ARGB, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc
 
   $ try m
-  ('symbol', 'm')
+  (symbol 'm')
   * expanded:
   (func
-    ('symbol', 'merge')
+    (symbol 'merge')
     None)
   * set:
   <filteredset
@@ -3506,17 +3506,17 @@
   $ HGPLAIN=1
   $ export HGPLAIN
   $ try m
-  ('symbol', 'm')
+  (symbol 'm')
   abort: unknown revision 'm'!
   [255]
 
   $ HGPLAINEXCEPT=revsetalias
   $ export HGPLAINEXCEPT
   $ try m
-  ('symbol', 'm')
+  (symbol 'm')
   * expanded:
   (func
-    ('symbol', 'merge')
+    (symbol 'merge')
     None)
   * set:
   <filteredset
@@ -3529,12 +3529,12 @@
 
   $ try 'p2(.)'
   (func
-    ('symbol', 'p2')
-    ('symbol', '.'))
+    (symbol 'p2')
+    (symbol '.'))
   * expanded:
   (func
-    ('symbol', 'p1')
-    ('symbol', '.'))
+    (symbol 'p1')
+    (symbol '.'))
   * set:
   <baseset+ [8]>
   8
@@ -3543,8 +3543,8 @@
   $ export HGPLAIN
   $ try 'p2(.)'
   (func
-    ('symbol', 'p2')
-    ('symbol', '.'))
+    (symbol 'p2')
+    (symbol '.'))
   * set:
   <baseset+ []>
 
@@ -3552,12 +3552,12 @@
   $ export HGPLAINEXCEPT
   $ try 'p2(.)'
   (func
-    ('symbol', 'p2')
-    ('symbol', '.'))
+    (symbol 'p2')
+    (symbol '.'))
   * expanded:
   (func
-    ('symbol', 'p1')
-    ('symbol', '.'))
+    (symbol 'p1')
+    (symbol '.'))
   * set:
   <baseset+ [8]>
   8
@@ -3568,12 +3568,12 @@
 test alias recursion
 
   $ try sincem
-  ('symbol', 'sincem')
+  (symbol 'sincem')
   * expanded:
   (func
-    ('symbol', 'descendants')
+    (symbol 'descendants')
     (func
-      ('symbol', 'merge')
+      (symbol 'merge')
       None))
   * set:
   <generatorset+>
@@ -3585,7 +3585,7 @@
   $ echo 'recurse1 = recurse2' >> .hg/hgrc
   $ echo 'recurse2 = recurse1' >> .hg/hgrc
   $ try recurse1
-  ('symbol', 'recurse1')
+  (symbol 'recurse1')
   hg: parse error: infinite expansion of revset alias "recurse1" detected
   [255]
 
@@ -3593,22 +3593,22 @@
   $ echo 'level2($1, $2) = level1($2, $1)' >> .hg/hgrc
   $ try "level2(level1(1, 2), 3)"
   (func
-    ('symbol', 'level2')
+    (symbol 'level2')
     (list
       (func
-        ('symbol', 'level1')
+        (symbol 'level1')
         (list
-          ('symbol', '1')
-          ('symbol', '2')))
-      ('symbol', '3')))
+          (symbol '1')
+          (symbol '2')))
+      (symbol '3')))
   * expanded:
   (or
     (list
-      ('symbol', '3')
+      (symbol '3')
       (or
         (list
-          ('symbol', '1')
-          ('symbol', '2')))))
+          (symbol '1')
+          (symbol '2')))))
   * set:
   <addset
     <baseset [3]>,
@@ -3624,16 +3624,16 @@
   $ echo 'nested3($1) = max($1)' >> .hg/hgrc
   $ try 'nested(2:5)'
   (func
-    ('symbol', 'nested')
+    (symbol 'nested')
     (range
-      ('symbol', '2')
-      ('symbol', '5')))
+      (symbol '2')
+      (symbol '5')))
   * expanded:
   (func
-    ('symbol', 'max')
+    (symbol 'max')
     (range
-      ('symbol', '2')
-      ('symbol', '5')))
+      (symbol '2')
+      (symbol '5')))
   * set:
   <baseset
     <max
@@ -3646,29 +3646,29 @@
   $ echo 'chainedorops($1, $2, $3) = $1|$2|$3' >> .hg/hgrc
   $ try 'chainedorops(0:1, 1:2, 2:3)'
   (func
-    ('symbol', 'chainedorops')
+    (symbol 'chainedorops')
     (list
       (range
-        ('symbol', '0')
-        ('symbol', '1'))
+        (symbol '0')
+        (symbol '1'))
       (range
-        ('symbol', '1')
-        ('symbol', '2'))
+        (symbol '1')
+        (symbol '2'))
       (range
-        ('symbol', '2')
-        ('symbol', '3'))))
+        (symbol '2')
+        (symbol '3'))))
   * expanded:
   (or
     (list
       (range
-        ('symbol', '0')
-        ('symbol', '1'))
+        (symbol '0')
+        (symbol '1'))
       (range
-        ('symbol', '1')
-        ('symbol', '2'))
+        (symbol '1')
+        (symbol '2'))
       (range
-        ('symbol', '2')
-        ('symbol', '3'))))
+        (symbol '2')
+        (symbol '3'))))
   * set:
   <addset
     <spanset+ 0:2>,
@@ -3688,16 +3688,16 @@
   $ echo 'callinjection($1) = descendants(injectparamasstring)' >> .hg/hgrc
   $ try 'callinjection(2:5)'
   (func
-    ('symbol', 'callinjection')
+    (symbol 'callinjection')
     (range
-      ('symbol', '2')
-      ('symbol', '5')))
+      (symbol '2')
+      (symbol '5')))
   * expanded:
   (func
-    ('symbol', 'descendants')
+    (symbol 'descendants')
     (func
-      ('symbol', 'max')
-      ('string', '$1')))
+      (symbol 'max')
+      (string '$1')))
   abort: unknown revision '$1'!
   [255]
 
@@ -3708,13 +3708,13 @@
   $ echo 'shadowall(all) = all and universe' >> .hg/hgrc
   $ try 'shadowall(0)'
   (func
-    ('symbol', 'shadowall')
-    ('symbol', '0'))
+    (symbol 'shadowall')
+    (symbol '0'))
   * expanded:
   (and
-    ('symbol', '0')
+    (symbol '0')
     (func
-      ('symbol', 'all')
+      (symbol 'all')
       None))
   * set:
   <filteredset
@@ -3726,26 +3726,26 @@
 
   $ try "unknownref(0)" --config 'revsetalias.unknownref($1)=$1:$2'
   (func
-    ('symbol', 'unknownref')
-    ('symbol', '0'))
+    (symbol 'unknownref')
+    (symbol '0'))
   abort: bad definition of revset alias "unknownref": invalid symbol '$2'
   [255]
 
   $ hg debugrevspec --debug --config revsetalias.anotherbadone='branch(' "tip"
-  ('symbol', 'tip')
+  (symbol 'tip')
   warning: bad definition of revset alias "anotherbadone": at 7: not a prefix: end
   * set:
   <baseset [9]>
   9
 
   $ try 'tip'
-  ('symbol', 'tip')
+  (symbol 'tip')
   * set:
   <baseset [9]>
   9
 
   $ hg debugrevspec --debug --config revsetalias.'bad name'='tip' "tip"
-  ('symbol', 'tip')
+  (symbol 'tip')
   warning: bad declaration of revset alias "bad name": at 4: invalid token
   * set:
   <baseset [9]>
@@ -3753,17 +3753,17 @@
   $ echo 'strictreplacing($1, $10) = $10 or desc("$1")' >> .hg/hgrc
   $ try 'strictreplacing("foo", tip)'
   (func
-    ('symbol', 'strictreplacing')
+    (symbol 'strictreplacing')
     (list
-      ('string', 'foo')
-      ('symbol', 'tip')))
+      (string 'foo')
+      (symbol 'tip')))
   * expanded:
   (or
     (list
-      ('symbol', 'tip')
+      (symbol 'tip')
       (func
-        ('symbol', 'desc')
-        ('string', '$1'))))
+        (symbol 'desc')
+        (string '$1'))))
   * set:
   <addset
     <baseset [9]>,
@@ -3774,20 +3774,20 @@
 
   $ try 'd(2:5)'
   (func
-    ('symbol', 'd')
+    (symbol 'd')
     (range
-      ('symbol', '2')
-      ('symbol', '5')))
+      (symbol '2')
+      (symbol '5')))
   * expanded:
   (func
-    ('symbol', 'reverse')
+    (symbol 'reverse')
     (func
-      ('symbol', 'sort')
+      (symbol 'sort')
       (list
         (range
-          ('symbol', '2')
-          ('symbol', '5'))
-        ('symbol', 'date'))))
+          (symbol '2')
+          (symbol '5'))
+        (symbol 'date'))))
   * set:
   <baseset [4, 5, 3, 2]>
   4
@@ -3796,71 +3796,71 @@
   2
   $ try 'rs(2 or 3, date)'
   (func
-    ('symbol', 'rs')
+    (symbol 'rs')
     (list
       (or
         (list
-          ('symbol', '2')
-          ('symbol', '3')))
-      ('symbol', 'date')))
+          (symbol '2')
+          (symbol '3')))
+      (symbol 'date')))
   * expanded:
   (func
-    ('symbol', 'reverse')
+    (symbol 'reverse')
     (func
-      ('symbol', 'sort')
+      (symbol 'sort')
       (list
         (or
           (list
-            ('symbol', '2')
-            ('symbol', '3')))
-        ('symbol', 'date'))))
+            (symbol '2')
+            (symbol '3')))
+        (symbol 'date'))))
   * set:
   <baseset [3, 2]>
   3
   2
   $ try 'rs()'
   (func
-    ('symbol', 'rs')
+    (symbol 'rs')
     None)
   hg: parse error: invalid number of arguments: 0
   [255]
   $ try 'rs(2)'
   (func
-    ('symbol', 'rs')
-    ('symbol', '2'))
+    (symbol 'rs')
+    (symbol '2'))
   hg: parse error: invalid number of arguments: 1
   [255]
   $ try 'rs(2, data, 7)'
   (func
-    ('symbol', 'rs')
+    (symbol 'rs')
     (list
-      ('symbol', '2')
-      ('symbol', 'data')
-      ('symbol', '7')))
+      (symbol '2')
+      (symbol 'data')
+      (symbol '7')))
   hg: parse error: invalid number of arguments: 3
   [255]
   $ try 'rs4(2 or 3, x, x, date)'
   (func
-    ('symbol', 'rs4')
+    (symbol 'rs4')
     (list
       (or
         (list
-          ('symbol', '2')
-          ('symbol', '3')))
-      ('symbol', 'x')
-      ('symbol', 'x')
-      ('symbol', 'date')))
+          (symbol '2')
+          (symbol '3')))
+      (symbol 'x')
+      (symbol 'x')
+      (symbol 'date')))
   * expanded:
   (func
-    ('symbol', 'reverse')
+    (symbol 'reverse')
     (func
-      ('symbol', 'sort')
+      (symbol 'sort')
       (list
         (or
           (list
-            ('symbol', '2')
-            ('symbol', '3')))
-        ('symbol', 'date'))))
+            (symbol '2')
+            (symbol '3')))
+        (symbol 'date'))))
   * set:
   <baseset [3, 2]>
   3
@@ -3927,16 +3927,16 @@
   $ try 'limit(1 or 2 or 3, 2) and not 2'
   (and
     (func
-      ('symbol', 'limit')
+      (symbol 'limit')
       (list
         (or
           (list
-            ('symbol', '1')
-            ('symbol', '2')
-            ('symbol', '3')))
-        ('symbol', '2')))
+            (symbol '1')
+            (symbol '2')
+            (symbol '3')))
+        (symbol '2')))
     (not
-      ('symbol', '2')))
+      (symbol '2')))
   * set:
   <filteredset
     <baseset [1, 2]>,
@@ -3946,13 +3946,13 @@
   $ try 'max(1 or 2) and not 2'
   (and
     (func
-      ('symbol', 'max')
+      (symbol 'max')
       (or
         (list
-          ('symbol', '1')
-          ('symbol', '2'))))
+          (symbol '1')
+          (symbol '2'))))
     (not
-      ('symbol', '2')))
+      (symbol '2')))
   * set:
   <filteredset
     <baseset
@@ -3964,13 +3964,13 @@
   $ try 'min(1 or 2) and not 1'
   (and
     (func
-      ('symbol', 'min')
+      (symbol 'min')
       (or
         (list
-          ('symbol', '1')
-          ('symbol', '2'))))
+          (symbol '1')
+          (symbol '2'))))
     (not
-      ('symbol', '1')))
+      (symbol '1')))
   * set:
   <filteredset
     <baseset
@@ -3982,15 +3982,15 @@
   $ try 'last(1 or 2, 1) and not 2'
   (and
     (func
-      ('symbol', 'last')
+      (symbol 'last')
       (list
         (or
           (list
-            ('symbol', '1')
-            ('symbol', '2')))
-        ('symbol', '1')))
+            (symbol '1')
+            (symbol '2')))
+        (symbol '1')))
     (not
-      ('symbol', '2')))
+      (symbol '2')))
   * set:
   <filteredset
     <baseset [2]>,
@@ -4065,12 +4065,12 @@
   (_concat
     (_concat
       (_concat
-        ('symbol', '278')
-        ('string', '5f5'))
-      ('symbol', '1ee'))
-    ('string', 'ce5'))
+        (symbol '278')
+        (string '5f5'))
+      (symbol '1ee'))
+    (string 'ce5'))
   * concatenated:
-  ('string', '2785f51eece5')
+  (string '2785f51eece5')
   * set:
   <baseset [0]>
   0
@@ -4078,22 +4078,22 @@
   $ echo 'cat4($1, $2, $3, $4) = $1 ## $2 ## $3 ## $4' >> .hg/hgrc
   $ try "cat4(278, '5f5', 1ee, 'ce5')"
   (func
-    ('symbol', 'cat4')
+    (symbol 'cat4')
     (list
-      ('symbol', '278')
-      ('string', '5f5')
-      ('symbol', '1ee')
-      ('string', 'ce5')))
+      (symbol '278')
+      (string '5f5')
+      (symbol '1ee')
+      (string 'ce5')))
   * expanded:
   (_concat
     (_concat
       (_concat
-        ('symbol', '278')
-        ('string', '5f5'))
-      ('symbol', '1ee'))
-    ('string', 'ce5'))
+        (symbol '278')
+        (string '5f5'))
+      (symbol '1ee'))
+    (string 'ce5'))
   * concatenated:
-  ('string', '2785f51eece5')
+  (string '2785f51eece5')
   * set:
   <baseset [0]>
   0
@@ -4370,98 +4370,98 @@
   * analyzed:
   (and
     (func
-      ('symbol', 'draft')
+      (symbol 'draft')
       None)
     (func
-      ('symbol', 'ancestors')
+      (symbol 'ancestors')
       (or
         (list
           (and
             (or
               (list
-                ('symbol', 'S1')
-                ('symbol', 'D1')
-                ('symbol', 'P5')))
+                (symbol 'S1')
+                (symbol 'D1')
+                (symbol 'P5')))
             (not
-              ('symbol', 'D3')))
-          ('symbol', 'S2')))))
+              (symbol 'D3')))
+          (symbol 'S2')))))
   * optimized:
   (func
-    ('symbol', '_phaseandancestors')
+    (symbol '_phaseandancestors')
     (list
-      ('symbol', 'draft')
+      (symbol 'draft')
       (or
         (list
           (difference
             (func
-              ('symbol', '_list')
-              ('string', 'S1\x00D1\x00P5'))
-            ('symbol', 'D3'))
-          ('symbol', 'S2')))))
+              (symbol '_list')
+              (string 'S1\x00D1\x00P5'))
+            (symbol 'D3'))
+          (symbol 'S2')))))
   $ hg debugrevspec --verify -p analyzed -p optimized 'secret() & ::9'
   * analyzed:
   (and
     (func
-      ('symbol', 'secret')
+      (symbol 'secret')
       None)
     (func
-      ('symbol', 'ancestors')
-      ('symbol', '9')))
+      (symbol 'ancestors')
+      (symbol '9')))
   * optimized:
   (func
-    ('symbol', '_phaseandancestors')
+    (symbol '_phaseandancestors')
     (list
-      ('symbol', 'secret')
-      ('symbol', '9')))
+      (symbol 'secret')
+      (symbol '9')))
   $ hg debugrevspec --verify -p analyzed -p optimized '7 & ( (not public()) & ::(tag()) )'
   * analyzed:
   (and
-    ('symbol', '7')
+    (symbol '7')
     (and
       (not
         (func
-          ('symbol', 'public')
+          (symbol 'public')
           None))
       (func
-        ('symbol', 'ancestors')
+        (symbol 'ancestors')
         (func
-          ('symbol', 'tag')
+          (symbol 'tag')
           None))))
   * optimized:
   (and
-    ('symbol', '7')
+    (symbol '7')
     (func
-      ('symbol', '_phaseandancestors')
+      (symbol '_phaseandancestors')
       (list
-        ('symbol', '_notpublic')
+        (symbol '_notpublic')
         (func
-          ('symbol', 'tag')
+          (symbol 'tag')
           None))))
   $ hg debugrevspec --verify -p optimized '(not public()) & ancestors(S1+D2+P5, 1)'
   * optimized:
   (and
     (func
-      ('symbol', '_notpublic')
+      (symbol '_notpublic')
       None)
     (func
-      ('symbol', 'ancestors')
+      (symbol 'ancestors')
       (list
         (func
-          ('symbol', '_list')
-          ('string', 'S1\x00D2\x00P5'))
-        ('symbol', '1'))))
+          (symbol '_list')
+          (string 'S1\x00D2\x00P5'))
+        (symbol '1'))))
   $ hg debugrevspec --verify -p optimized '(not public()) & ancestors(S1+D2+P5, depth=1)'
   * optimized:
   (and
     (func
-      ('symbol', '_notpublic')
+      (symbol '_notpublic')
       None)
     (func
-      ('symbol', 'ancestors')
+      (symbol 'ancestors')
       (list
         (func
-          ('symbol', '_list')
-          ('string', 'S1\x00D2\x00P5'))
+          (symbol '_list')
+          (string 'S1\x00D2\x00P5'))
         (keyvalue
-          ('symbol', 'depth')
-          ('symbol', '1')))))
+          (symbol 'depth')
+          (symbol '1')))))