templater: rename parsestring() to unquotestring() (API)
authorYuya Nishihara <yuya@tcha.org>
Mon, 04 May 2015 10:03:13 +0900
changeset 24988 e8ff0b09acac
parent 24987 fd7287f0b43c
child 24989 3098dcd2d167
templater: rename parsestring() to unquotestring() (API) Since db7463aa080f, it doesn't parse string escapes.
mercurial/cmdutil.py
mercurial/templater.py
--- a/mercurial/cmdutil.py	Mon May 04 10:01:03 2015 +0900
+++ b/mercurial/cmdutil.py	Mon May 04 10:03:13 2015 +0900
@@ -1443,7 +1443,7 @@
         tmpl = ui.config('ui', 'logtemplate')
         if tmpl:
             try:
-                tmpl = templater.parsestring(tmpl)
+                tmpl = templater.unquotestring(tmpl)
             except SyntaxError:
                 pass
             return tmpl, None
@@ -1477,7 +1477,7 @@
     t = ui.config('templates', tmpl)
     if t:
         try:
-            tmpl = templater.parsestring(t)
+            tmpl = templater.unquotestring(t)
         except SyntaxError:
             tmpl = t
         return tmpl, None
--- a/mercurial/templater.py	Mon May 04 10:01:03 2015 +0900
+++ b/mercurial/templater.py	Mon May 04 10:03:13 2015 +0900
@@ -618,7 +618,7 @@
                 for j in _flatten(i):
                     yield j
 
-def parsestring(s):
+def unquotestring(s):
     '''unwrap quotes'''
     if len(s) < 2 or s[0] != s[-1]:
         raise SyntaxError(_('unmatched quotes'))
@@ -728,7 +728,7 @@
                 raise SyntaxError(_('%s: missing value') % conf.source('', key))
             if val[0] in "'\"":
                 try:
-                    self.cache[key] = parsestring(val)
+                    self.cache[key] = unquotestring(val)
                 except SyntaxError, inst:
                     raise SyntaxError('%s: %s' %
                                       (conf.source('', key), inst.args[0]))