diff hgext/color.py @ 20067:3d8bfe2ecf6d stable

templater: only recursively evaluate string literals as templates (issue4103)
author Matt Mackall <mpm@selenic.com>
date Mon, 18 Nov 2013 15:37:09 -0500
parents 49d4919d21c2
children a2c08adbb86e 7e627fe63e5e
line wrap: on
line diff
--- a/hgext/color.py	Mon Nov 18 14:02:26 2013 -0500
+++ b/hgext/color.py	Mon Nov 18 15:37:09 2013 -0500
@@ -386,9 +386,7 @@
         # i18n: "label" is a keyword
         raise error.ParseError(_("label expects two arguments"))
 
-    thing = templater.stringify(args[1][0](context, mapping, args[1][1]))
-    thing = templater.runtemplate(context, mapping,
-                                  templater.compiletemplate(thing, context))
+    thing = templater._evalifliteral(args[1], context, mapping)
 
     # apparently, repo could be a string that is the favicon?
     repo = mapping.get('repo', '')