diff mercurial/templater.py @ 25638:6047b60cdd09 stable

templater: fix handling of \-escapes in raw string literals The backslash character should start escape sequences no matter if a string is prefixed with 'r'. They are just not interpreted as escape sequences in raw strings. revset.tokenize() handles them correctly, but templater didn't. https://docs.python.org/2/reference/lexical_analysis.html#string-literals
author Yuya Nishihara <yuya@tcha.org>
date Sun, 21 Jun 2015 13:24:43 +0900
parents 5eccebe23942
children ff5172c83002 ec9c258e666d
line wrap: on
line diff
--- a/mercurial/templater.py	Sat Jun 20 23:13:34 2015 +0900
+++ b/mercurial/templater.py	Sun Jun 21 13:24:43 2015 +0900
@@ -47,7 +47,7 @@
             s = pos
             while pos < end: # find closing quote
                 d = program[pos]
-                if decode and d == '\\': # skip over escaped characters
+                if d == '\\': # skip over escaped characters
                     pos += 2
                     continue
                 if d == c: