comparison tests/test-command-template.t @ 20857:6eb55310fcbc stable

templater: raise error for unknown func Previously, if a template '{foo()}' was given, the buildfunc would not be able to match it and hit a code path that would not return so it would error out later in the templater stating that NoneType was not iterable. This patch makes sure that a proper error is raised so that the user can be informed. Tests have been updated.
author Sean Farley <sean.michael.farley@gmail.com>
date Thu, 27 Mar 2014 17:21:27 -0500
parents 5ab28a2e9962
children 81d6dc8c3c63
comparison
equal deleted inserted replaced
20826:dd2e25e49862 20857:6eb55310fcbc
1414 1414
1415 $ hg tip --template '{author|email|date}\n' 1415 $ hg tip --template '{author|email|date}\n'
1416 abort: template filter 'datefilter' is not compatible with keyword 'author' 1416 abort: template filter 'datefilter' is not compatible with keyword 'author'
1417 [255] 1417 [255]
1418 1418
1419 Thrown an error if a template function doesn't exist
1420
1421 $ hg tip --template '{foo()}\n'
1422 hg: parse error: unknown function 'foo'
1423 [255]
1424
1419 $ cd .. 1425 $ cd ..
1420 1426
1421 1427
1422 latesttag: 1428 latesttag:
1423 1429