Mercurial > hg-stable
comparison 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 |
comparison
equal
deleted
inserted
replaced
36697:e77cee5de1c7 | 36698:80d7fb6c2dec |
---|---|
2287 summary: a bunch of weird directories | 2287 summary: a bunch of weird directories |
2288 | 2288 |
2289 $ hg --config extensions.names=../names.py log -r 0 --template '{bars}\n' | 2289 $ hg --config extensions.names=../names.py log -r 0 --template '{bars}\n' |
2290 foo | 2290 foo |
2291 | 2291 |
2292 Templater parse errors: | |
2293 | |
2294 simple error | |
2295 $ hg log -r . -T '{shortest(node}' | |
2296 hg: parse error at 15: unexpected token: end | |
2297 ({shortest(node} | |
2298 ^ here) | |
2299 [255] | |
2300 | |
2301 multi-line template with error | |
2302 $ hg log -r . -T 'line 1 | |
2303 > line2 | |
2304 > {shortest(node} | |
2305 > line4\nline5' | |
2306 hg: parse error at 28: unexpected token: end | |
2307 [255] | |
2308 | |
2292 $ cd .. | 2309 $ cd .. |
2293 | 2310 |
2294 hg log -f dir across branches | 2311 hg log -f dir across branches |
2295 | 2312 |
2296 $ hg init acrossbranches | 2313 $ hg init acrossbranches |