Mercurial > public > mercurial-scm > hg
diff tests/test-command-template.t @ 17383:099c778ceb33
templater: abort when a template filter raises an exception (issue2987)
author | Neil Kodner <neilk@fb.com> |
---|---|
date | Fri, 17 Aug 2012 15:12:01 -0700 |
parents | 4f8054d3171b |
children | 4b87d947c4e1 |
line wrap: on
line diff
--- a/tests/test-command-template.t Sat Aug 11 12:45:53 2012 -0500 +++ b/tests/test-command-template.t Fri Aug 17 15:12:01 2012 -0700 @@ -1255,6 +1255,30 @@ abort: t:3: unmatched quotes [255] +Behind the scenes, this will throw TypeError + + $ hg log -l 3 --template '{date|obfuscate}\n' + abort: Template filter 'obfuscate' is not compatible with keyword 'date' + [255] + +Behind the scenes, this will throw a ValueError + + $ hg log -l 3 --template 'line: {desc|shortdate}\n' + abort: Template filter 'shortdate' is not compatible with keyword 'desc' + [255] + +Behind the scenes, this will throw AttributeError + + $ hg log -l 3 --template 'line: {date|escape}\n' + abort: Template filter 'escape' is not compatible with keyword 'date' + [255] + +Behind the scenes, this will throw ValueError + + $ hg tip --template '{author|email|date}\n' + abort: Template filter 'datefilter' is not compatible with keyword 'author' + [255] + $ cd ..