comparison tests/test-command-template.t @ 38243:06d11cd90516

templater: promote getmember() to an interface of wrapped types
author Yuya Nishihara <yuya@tcha.org>
date Wed, 21 Mar 2018 11:30:21 +0900
parents 7701c2d4a438
children 41ae9b3cbfb9
comparison
equal deleted inserted replaced
38242:12b6ee9e88f3 38243:06d11cd90516
3343 ce3cec86e6c26bd9bdfc590a6b92abc9680f1796 3343 ce3cec86e6c26bd9bdfc590a6b92abc9680f1796
3344 $ hg log -R latesttag -r0 -T '{extras.branch}\n' 3344 $ hg log -R latesttag -r0 -T '{extras.branch}\n'
3345 default 3345 default
3346 3346
3347 $ hg log -R latesttag -l1 -T '{author.invalid}\n' 3347 $ hg log -R latesttag -l1 -T '{author.invalid}\n'
3348 hg: parse error: keyword 'author' has no member 3348 hg: parse error: 'test' is not a dictionary
3349 (keyword 'author' does not support member operation)
3349 [255] 3350 [255]
3350 $ hg log -R latesttag -l1 -T '{min("abc").invalid}\n' 3351 $ hg log -R latesttag -l1 -T '{min("abc").invalid}\n'
3351 hg: parse error: 'a' has no member 3352 hg: parse error: 'a' is not a dictionary
3352 [255] 3353 [255]
3353 3354
3354 Test the sub function of templating for expansion: 3355 Test the sub function of templating for expansion:
3355 3356
3356 $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n' 3357 $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n'
3849 $ hg log -r 0 --template '{get(extras, "branch")}\n' 3850 $ hg log -r 0 --template '{get(extras, "branch")}\n'
3850 default 3851 default
3851 $ hg log -r 0 --template '{get(extras, "br{"anch"}")}\n' 3852 $ hg log -r 0 --template '{get(extras, "br{"anch"}")}\n'
3852 default 3853 default
3853 $ hg log -r 0 --template '{get(files, "should_fail")}\n' 3854 $ hg log -r 0 --template '{get(files, "should_fail")}\n'
3854 hg: parse error: get() expects a dict as first argument 3855 hg: parse error: not a dictionary
3856 (get() expects a dict as first argument)
3855 [255] 3857 [255]
3856 3858
3857 Test json filter applied to hybrid object: 3859 Test json filter applied to hybrid object:
3858 3860
3859 $ hg log -r0 -T '{files|json}\n' 3861 $ hg log -r0 -T '{files|json}\n'