Comments
Patch
@@ -310,10 +310,7 @@ def pad(context, mapping, args):
width = int(args[1][1])
- text = stringify(args[0][0](context, mapping, args[0][1]))
- if args[0][0] == runstring:
- text = stringify(runtemplate(context, mapping,
- compiletemplate(text, context)))
+ text = stringify(_evalifliteral(args[0], context, mapping))
right = False
fillchar = ' '
@@ -3042,6 +3042,14 @@ Test pad function
1------------------- {node|short}
0------------------- test
+Test template string in pad function
+
+ $ hg log -r 0 -T '{pad("\{{rev}}", 10)} {author|user}\n'
+ {0} test
+
+ $ hg log -r 0 -T '{pad(r"\{rev}", 10)} {author|user}\n'
+ \0 test
+
Test ifcontains function
$ hg log --template '{rev} {ifcontains(rev, "2 two 0", "is in the string", "is not")}\n'