Mercurial > public > mercurial-scm > hg
diff tests/test-command-template.t @ 27940:cfe7da66f555 stable
templater: abort if infinite recursion detected while compiling
In this case, a template is parsed recursively with no thunk for lazy
evaluation. This patch prevents recursion by putting a dummy of the same name
into a cache that will be referenced while parsing if there's a recursion.
changeset = {files % changeset}\n
~~~~~~~~~
= [(_runrecursivesymbol, 'changeset')]
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 23 Jul 2015 23:41:29 +0900 |
parents | 7ed3a3c0cef1 |
children | 90cff855ae1c |
line wrap: on
line diff
--- a/tests/test-command-template.t Wed Jul 22 23:29:41 2015 +0900 +++ b/tests/test-command-template.t Thu Jul 23 23:41:29 2015 +0900 @@ -1053,6 +1053,12 @@ abort: recursive reference 'foo' in template [255] + buildmap() -> gettemplate(), where no thunk was made: + + $ hg log -T '{files % changeset}\n' + abort: recursive reference 'changeset' in template + [255] + not a recursion if a keyword of the same name exists: $ cat << EOF > issue4758