Comments
Patch
@@ -210,7 +210,7 @@ def getlist(x):
def gettemplate(exp, context):
"""Compile given template tree or load named template from map file;
returns (func, data) pair"""
- if exp[0] == 'template':
+ if exp[0] in ('template', 'string'):
return compileexp(exp, context, methods)
if exp[0] == 'symbol':
# unlike runsymbol(), here 'symbol' is always taken as template name
@@ -2900,12 +2900,8 @@ Test string literal:
template: 0
$ hg log -Ra -r0 -T '{r"rawstring: {rev}"}\n'
rawstring: {rev}
-
-because map operation requires template, raw string can't be used
-
- $ hg log -Ra -r0 -T '{files % r"rawstring"}\n'
- hg: parse error: expected template specifier
- [255]
+ $ hg log -Ra -r0 -T '{files % r"rawstring: {file}"}\n'
+ rawstring: {file}
Test string escaping: