changeset 28897:c1f254138f44

parser: add short comment how aliases are expanded in phases
author Yuya Nishihara <yuya@tcha.org>
date Tue, 29 Mar 2016 16:30:59 +0900
parents 4c76a032ec7e
children 8d398155bfda
files mercurial/parser.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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')