From patchwork Wed Mar 30 15:38:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [4, of, 4] revset: make _parsealiasdecl() simply return the original parsed tree From: Yuya Nishihara X-Patchwork-Id: 14190 Message-Id: <744b168050832926b97d.1459352301@mimosa> To: mercurial-devel@mercurial-scm.org Date: Thu, 31 Mar 2016 00:38:21 +0900 # HG changeset patch # User Yuya Nishihara # 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: