# HG changeset patch # User Sean Farley # Date 1397517686 18000 # Node ID b775a2029e8d9a7494a1c274f0079988e915bed4 # Parent a1a1bd09e4f40894be56c69e278dd99146b2c048 color: add effect to the template symbol table Previously, words like 'red' had to be protected by quotes before passing to the label template function. Now, we add color effects to the symbol table so that commands like, $ hg log -r . -T "{label(red, node|short)}\n" can work without the need for quoting. diff -r a1a1bd09e4f4 -r b775a2029e8d hgext/color.py --- a/hgext/color.py Wed Apr 16 02:38:11 2014 +0900 +++ b/hgext/color.py Mon Apr 14 18:21:26 2014 -0500 @@ -395,6 +395,10 @@ # i18n: "label" is a keyword raise error.ParseError(_("label expects two arguments")) + # add known effects to the mapping so symbols like 'red', 'bold', + # etc. don't need to be quoted + mapping.update(dict([(k, k) for k in _effects])) + thing = templater._evalifliteral(args[1], context, mapping) # apparently, repo could be a string that is the favicon?