[PATCH 4 of 4] revset: make _parsealiasdecl() simply return the original parsed tree

Yuya Nishihara yuya at tcha.org
Wed Mar 30 11:38:21 EDT 2016


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1456735566 -32400
#      Mon Feb 29 17:46:06 2016 +0900
# Node ID 744b168050832926b97dfefe486d6f33bcc7d8b2
# Parent  ab9445ee0dbe55f4258645e065f7121df2c6f83a
revset: make _parsealiasdecl() simply return the original parsed tree

It wasn't necessary to reconstruct the same tuple.

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -2297,7 +2297,7 @@ def _parsealiasdecl(decl):
             name = tree[1]
             if name.startswith('$'):
                 return (decl, None, None, _("'$' not for alias arguments"))
-            return (name, ('symbol', name), None, None)
+            return (name, tree, None, None)
 
         if tree[0] == 'func' and tree[1][0] == 'symbol':
             # "name(arg, ....) = ...." style
@@ -2312,7 +2312,7 @@ def _parsealiasdecl(decl):
             if len(args) != len(set(args)):
                 return (name, None, None,
                         _("argument names collide with each other"))
-            return (name, ('func', ('symbol', name)), args, None)
+            return (name, tree[:2], args, None)
 
         return (decl, None, None, _("invalid format"))
     except error.ParseError as inst:


More information about the Mercurial-devel mailing list