##// END OF EJS Templates
templates: fix ifcontains against sets with length > 1 (issue4259)...
Durham Goode -
r21540:d8fb8353 stable
parent child Browse files
Show More
@@ -310,7 +310,9 b' def ifcontains(context, mapping, args):'
310 item = stringify(args[0][0](context, mapping, args[0][1]))
310 item = stringify(args[0][0](context, mapping, args[0][1]))
311 items = args[1][0](context, mapping, args[1][1])
311 items = args[1][0](context, mapping, args[1][1])
312
312
313 if item in items:
313 # Iterating over items gives a formatted string, so we iterate
314 # directly over the raw values.
315 if item in [i.values()[0] for i in items()]:
314 yield _evalifliteral(args[2], context, mapping)
316 yield _evalifliteral(args[2], context, mapping)
315 elif len(args) == 4:
317 elif len(args) == 4:
316 yield _evalifliteral(args[3], context, mapping)
318 yield _evalifliteral(args[3], context, mapping)
@@ -1819,6 +1819,11 b' Test revset function'
1819 1 not current rev
1819 1 not current rev
1820 0 not current rev
1820 0 not current rev
1821
1821
1822 $ hg log --template '{rev} {ifcontains(rev, revset(". + .^"), "match rev", "not match rev")}\n'
1823 2 match rev
1824 1 match rev
1825 0 not match rev
1826
1822 $ hg log --template '{rev} Parents: {revset("parents(%s)", rev)}\n'
1827 $ hg log --template '{rev} Parents: {revset("parents(%s)", rev)}\n'
1823 2 Parents: 1
1828 2 Parents: 1
1824 1 Parents: 0
1829 1 Parents: 0
General Comments 0
You need to be logged in to leave comments. Login now