diff -r 5a2d505a9174 -r 077ee15b8493 mercurial/templater.py --- a/mercurial/templater.py Fri Jul 14 19:59:10 2017 +0200 +++ b/mercurial/templater.py Tue Jan 16 21:42:42 2018 +0900 @@ -184,6 +184,8 @@ return parsed, n + 1 parseres, pos = p.parse(tokenize(tmpl, n + 1, stop, '}')) + if not tmpl.endswith('}', n + 1, pos): + raise error.ParseError(_("invalid token"), pos) parsed.append(parseres) if quote: