mercurial/templater.py
changeset 24987 fd7287f0b43c
parent 24966 554d6fcc3c84
child 24988 e8ff0b09acac
--- a/mercurial/templater.py	Tue Apr 14 12:45:15 2015 -0700
+++ b/mercurial/templater.py	Mon May 04 10:01:03 2015 +0900
@@ -618,28 +618,25 @@
                 for j in _flatten(i):
                     yield j
 
-def parsestring(s, quoted=True):
-    '''unwrap quotes if quoted is True'''
-    if quoted:
-        if len(s) < 2 or s[0] != s[-1]:
-            raise SyntaxError(_('unmatched quotes'))
-        # de-backslash-ify only <\">. it is invalid syntax in non-string part of
-        # template, but we are likely to escape <"> in quoted string and it was
-        # accepted before, thanks to issue4290. <\\"> is unmodified because it
-        # is ambiguous and it was processed as such before 2.8.1.
-        #
-        #  template  result
-        #  --------- ------------------------
-        #  {\"\"}    parse error
-        #  "{""}"    {""} -> <>
-        #  "{\"\"}"  {""} -> <>
-        #  {"\""}    {"\""} -> <">
-        #  '{"\""}'  {"\""} -> <">
-        #  "{"\""}"  parse error (don't care)
-        q = s[0]
-        return s[1:-1].replace('\\\\' + q, '\\\\\\' + q).replace('\\' + q, q)
-
-    return s
+def parsestring(s):
+    '''unwrap quotes'''
+    if len(s) < 2 or s[0] != s[-1]:
+        raise SyntaxError(_('unmatched quotes'))
+    # de-backslash-ify only <\">. it is invalid syntax in non-string part of
+    # template, but we are likely to escape <"> in quoted string and it was
+    # accepted before, thanks to issue4290. <\\"> is unmodified because it
+    # is ambiguous and it was processed as such before 2.8.1.
+    #
+    #  template  result
+    #  --------- ------------------------
+    #  {\"\"}    parse error
+    #  "{""}"    {""} -> <>
+    #  "{\"\"}"  {""} -> <>
+    #  {"\""}    {"\""} -> <">
+    #  '{"\""}'  {"\""} -> <">
+    #  "{"\""}"  parse error (don't care)
+    q = s[0]
+    return s[1:-1].replace('\\\\' + q, '\\\\\\' + q).replace('\\' + q, q)
 
 class engine(object):
     '''template expansion engine.