Show More
@@ -466,7 +466,7 b' def ifcontains(context, mapping, args):' | |||
|
466 | 466 | raise error.ParseError(_("ifcontains expects three or four arguments")) |
|
467 | 467 | |
|
468 | 468 | item = stringify(args[0][0](context, mapping, args[0][1])) |
|
469 |
items = arg |
|
|
469 | items = evalfuncarg(context, mapping, args[1]) | |
|
470 | 470 | |
|
471 | 471 | if item in items: |
|
472 | 472 | yield args[2][0](context, mapping, args[2][1]) |
@@ -3248,6 +3248,11 b' Test ifcontains function' | |||
|
3248 | 3248 | 1 is not |
|
3249 | 3249 | 0 is in the string |
|
3250 | 3250 | |
|
3251 | $ hg log -T '{rev} {ifcontains(rev, "2 two{" 0"}", "is in the string", "is not")}\n' | |
|
3252 | 2 is in the string | |
|
3253 | 1 is not | |
|
3254 | 0 is in the string | |
|
3255 | ||
|
3251 | 3256 | $ hg log --template '{rev} {ifcontains("a", file_adds, "added a", "did not add a")}\n' |
|
3252 | 3257 | 2 did not add a |
|
3253 | 3258 | 1 did not add a |
General Comments 0
You need to be logged in to leave comments.
Login now