diff tests/test-log.t @ 36698:80d7fb6c2dec

templater: add hint to template parse errors to help locate issues Previously, we would print the error name and location, but this isn't as helpful as we can be. Let's add a hint that shows the location where we encountered the parse error. Differential Revision: https://phab.mercurial-scm.org/D2608
author Ryan McElroy <rmcelroy@fb.com>
date Sat, 03 Mar 2018 14:23:40 -0800
parents 58c1368ab629
children 44048f1bcee5
line wrap: on
line diff
--- a/tests/test-log.t	Fri Mar 02 07:17:06 2018 +0530
+++ b/tests/test-log.t	Sat Mar 03 14:23:40 2018 -0800
@@ -2289,6 +2289,23 @@
   $ hg --config extensions.names=../names.py log -r 0 --template '{bars}\n'
   foo
 
+Templater parse errors:
+
+simple error
+  $ hg log -r . -T '{shortest(node}'
+  hg: parse error at 15: unexpected token: end
+  ({shortest(node}
+                 ^ here)
+  [255]
+
+multi-line template with error
+  $ hg log -r . -T 'line 1
+  > line2
+  > {shortest(node}
+  > line4\nline5'
+  hg: parse error at 28: unexpected token: end
+  [255]
+
   $ cd ..
 
 hg log -f dir across branches