diff tests/test-template-engine.t @ 28831:6b86ce3e3576

templater: give better error message for invalid engine type Before, KeyError was caught at changeset_templater._show(), which said "no key named '%s'" as it was intended to catch the KeyError of unknown map key. Instead, we should catch KeyError explicitly for better error indication. For those who don't know what the template engine is (read "everyone"), it is hidden extension feature that allows switching template syntax in map file. See d8c5a7f25a40 for details.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 03 Apr 2016 11:20:50 +0900
parents 93b5c540db69
children d813132ea361
line wrap: on
line diff
--- a/tests/test-template-engine.t	Thu Apr 07 14:10:49 2016 -0700
+++ b/tests/test-template-engine.t	Sun Apr 03 11:20:50 2016 +0900
@@ -44,4 +44,11 @@
   0 97e5f848f0936960273bbf75be6388cd0350a32b -1 0000000000000000000000000000000000000000
   -1 0000000000000000000000000000000000000000 -1 0000000000000000000000000000000000000000
 
+invalid engine type:
+
+  $ echo 'changeset = unknown:changeset.txt' > unknownenginemap
+  $ hg log --style=./unknownenginemap
+  abort: invalid template engine: unknown
+  [255]
+
   $ cd ..