Show More
@@ -310,10 +310,7 def pad(context, mapping, args): | |||||
310 |
|
310 | |||
311 | width = int(args[1][1]) |
|
311 | width = int(args[1][1]) | |
312 |
|
312 | |||
313 |
text = stringify(args[0] |
|
313 | text = stringify(_evalifliteral(args[0], context, mapping)) | |
314 | if args[0][0] == runstring: |
|
|||
315 | text = stringify(runtemplate(context, mapping, |
|
|||
316 | compiletemplate(text, context))) |
|
|||
317 |
|
314 | |||
318 | right = False |
|
315 | right = False | |
319 | fillchar = ' ' |
|
316 | fillchar = ' ' |
@@ -3042,6 +3042,14 Test pad function | |||||
3042 | 1------------------- {node|short} |
|
3042 | 1------------------- {node|short} | |
3043 | 0------------------- test |
|
3043 | 0------------------- test | |
3044 |
|
3044 | |||
|
3045 | Test template string in pad function | |||
|
3046 | ||||
|
3047 | $ hg log -r 0 -T '{pad("\{{rev}}", 10)} {author|user}\n' | |||
|
3048 | {0} test | |||
|
3049 | ||||
|
3050 | $ hg log -r 0 -T '{pad(r"\{rev}", 10)} {author|user}\n' | |||
|
3051 | \0 test | |||
|
3052 | ||||
3045 | Test ifcontains function |
|
3053 | Test ifcontains function | |
3046 |
|
3054 | |||
3047 | $ hg log --template '{rev} {ifcontains(rev, "2 two 0", "is in the string", "is not")}\n' |
|
3055 | $ hg log --template '{rev} {ifcontains(rev, "2 two 0", "is in the string", "is not")}\n' |
General Comments 0
You need to be logged in to leave comments.
Login now