Patchwork [6,of,7] parser: add short comment how aliases are expanded in phases

login
register
mail settings
Submitter Yuya Nishihara
Date April 13, 2016, 3:55 p.m.
Message ID <389fab2ad6694be868f4.1460562918@mimosa>
Download mbox | patch
Permalink /patch/14584/
State Accepted
Commit c1f254138f44e64aac63b549f1f5763ae28c4a5a
Headers show

Comments

Yuya Nishihara - April 13, 2016, 3:55 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1459236659 -32400
#      Tue Mar 29 16:30:59 2016 +0900
# Node ID 389fab2ad6694be868f423e69e5c71bfffd62a8e
# Parent  b50d0a0a24d9cdd99531cf7172ce4b0d0c79c9f2
parser: add short comment how aliases are expanded in phases

Patch

diff --git a/mercurial/parser.py b/mercurial/parser.py
--- a/mercurial/parser.py
+++ b/mercurial/parser.py
@@ -518,6 +518,7 @@  class basealiasrules(object):
             raise error.ParseError(_('infinite expansion of %(section)s '
                                      '"%(name)s" detected')
                                    % {'section': cls._section, 'name': a.name})
+        # get cacheable replacement tree by expanding aliases recursively
         expanding.append(a)
         if a.name not in cache:
             cache[a.name] = cls._expand(aliases, a.replacement, expanding,
@@ -526,6 +527,7 @@  class basealiasrules(object):
         expanding.pop()
         if a.args is None:
             return result
+        # substitute function arguments in replacement tree
         l = cls._getlist(tree[2])
         if len(l) != len(a.args):
             raise error.ParseError(_('invalid number of arguments: %d')