parser: add short comment how aliases are expanded in phases
authorYuya Nishihara <yuya@tcha.org>
Tue, 29 Mar 2016 16:30:59 +0900
changeset 28897 c1f254138f44
parent 28896 4c76a032ec7e
child 28898 8d398155bfda
parser: add short comment how aliases are expanded in phases
mercurial/parser.py
--- a/mercurial/parser.py	Tue Mar 29 16:19:31 2016 +0900
+++ b/mercurial/parser.py	Tue Mar 29 16:30:59 2016 +0900
@@ -518,6 +518,7 @@
             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 @@
         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')