Mercurial > hg > mercurial-source
diff tests/test-revset.t @ 16772:30e46d7138de stable
revset: fix infinite alias expansion detection
The alias expansion code it changed from:
1- Get replacement tree
2- Substitute arguments in the replacement tree
3- Expand the replacement tree again
into:
1- Get the replacement tree
2- Expand the replacement tree
3- Expand the arguments
4- Substitute the expanded arguments in the replacement tree
and fixes cases like:
[revsetalias]
level1($1, $2) = $1 or $2
level2($1, $2) = level1($2, $1)
$ hg log -r "level2(level1(1, 2), 3)"
where the original version incorrectly aborted on infinite expansion
error, because it was confusing the expanded aliases with their
arguments.
author | Patrick Mezard <patrick@mezard.eu> |
---|---|
date | Sat, 19 May 2012 17:19:55 +0200 (2012-05-19) |
parents | 2f3317d53d51 |
children | 2ac08d8b21aa |
line wrap: on
line diff
--- a/tests/test-revset.t +++ b/tests/test-revset.t @@ -520,6 +520,27 @@ hg: parse error: infinite expansion of revset alias "recurse1" detected [255] + $ echo 'level1($1, $2) = $1 or $2' >> .hg/hgrc + $ echo 'level2($1, $2) = level1($2, $1)' >> .hg/hgrc + $ try "level2(level1(1, 2), 3)" + (func + ('symbol', 'level2') + (list + (func + ('symbol', 'level1') + (list + ('symbol', '1') + ('symbol', '2'))) + ('symbol', '3'))) + (or + ('symbol', '3') + (or + ('symbol', '1') + ('symbol', '2'))) + 3 + 1 + 2 + test nesting and variable passing $ echo 'nested($1) = nested2($1)' >> .hg/hgrc