comparison tests/test-command-template.t @ 37404:7c902a8345ef

templater: complain about invalid application of '%' operator (BC) Before, '{x % y % z ...}' was silently evaluated as '{x % y}'. We no longer need this hack since the web template bugs was fixed by earlier patches. At this point, the error message may contain '<generator *>', which will be fixed later.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 18 Mar 2018 21:01:23 +0900
parents 05db42732fce
children afd7b0afe4a6
comparison
equal deleted inserted replaced
37403:448f7ec247e2 37404:7c902a8345ef
3208 $ hg log -R latesttag -r tip --template 'modified files: {file_mods % " {file}\n"}\n' 3208 $ hg log -R latesttag -r tip --template 'modified files: {file_mods % " {file}\n"}\n'
3209 modified files: .hgtags 3209 modified files: .hgtags
3210 3210
3211 3211
3212 $ hg log -R latesttag -r tip -T '{rev % "a"}\n' 3212 $ hg log -R latesttag -r tip -T '{rev % "a"}\n'
3213 hg: parse error: keyword 'rev' is not iterable 3213 hg: parse error: keyword 'rev' is not iterable of mappings
3214 [255] 3214 [255]
3215 $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "a"}\n' 3215 $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "a"}\n'
3216 hg: parse error: None is not iterable 3216 hg: parse error: None is not iterable of mappings
3217 [255]
3218 $ hg log -R latesttag -r tip -T '{extras % "{key}\n" % "{key}\n"}'
3219 hg: parse error: <generator *> is not iterable of mappings (glob)
3217 [255] 3220 [255]
3218 3221
3219 Test new-style inline templating of non-list/dict type: 3222 Test new-style inline templating of non-list/dict type:
3220 3223
3221 $ hg log -R latesttag -r tip -T '{manifest}\n' 3224 $ hg log -R latesttag -r tip -T '{manifest}\n'
3226 11:2bc6e9006ce29882383a22d39fd1f4e66dd3e2fc 3229 11:2bc6e9006ce29882383a22d39fd1f4e66dd3e2fc
3227 3230
3228 $ hg log -R latesttag -r tip -T '{get(extras, "branch") % "{key}: {value}\n"}' 3231 $ hg log -R latesttag -r tip -T '{get(extras, "branch") % "{key}: {value}\n"}'
3229 branch: default 3232 branch: default
3230 $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "{key}\n"}' 3233 $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "{key}\n"}'
3231 hg: parse error: None is not iterable 3234 hg: parse error: None is not iterable of mappings
3232 [255] 3235 [255]
3233 $ hg log -R latesttag -r tip -T '{min(extras) % "{key}: {value}\n"}' 3236 $ hg log -R latesttag -r tip -T '{min(extras) % "{key}: {value}\n"}'
3234 branch: default 3237 branch: default
3235 $ hg log -R latesttag -l1 -T '{min(revset("0:9")) % "{rev}:{node|short}\n"}' 3238 $ hg log -R latesttag -l1 -T '{min(revset("0:9")) % "{rev}:{node|short}\n"}'
3236 0:ce3cec86e6c2 3239 0:ce3cec86e6c2