# HG changeset patch # User Yuya Nishihara # Date 1434376842 -32400 # Node ID 8b900b937e1c11b2018350da4b41054444422765 # Parent cd842821db2c185d350e0d12134c7a9db1036607 templater: respect stop position while parsing template string It has no effect now because stop is len(tmpl). diff -r cd842821db2c -r 8b900b937e1c mercurial/templater.py --- a/mercurial/templater.py Sun Jul 12 18:04:48 2015 +0800 +++ b/mercurial/templater.py Mon Jun 15 23:00:42 2015 +0900 @@ -132,9 +132,10 @@ pos, stop = 0, len(tmpl) p = parser.parser(elements) while pos < stop: - n = tmpl.find('{', pos) + n = tmpl.find('{', pos, stop) if n < 0: - parsed.append(('string', tmpl[pos:])) + parsed.append(('string', tmpl[pos:stop])) + pos = stop break bs = (n - pos) - len(tmpl[pos:n].rstrip('\\')) if bs % 2 == 1: