templater: respect stop position while parsing template string
It has no effect now because stop is len(tmpl).
--- 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: