$ hg log -T '{ifcontains(rev, revset("1"), "{rev}\n")}' 1 $ hg log -T '{ifcontains(rev, revset("1 or 2"), "{rev}\n")}' $ The ifcontains check ends up doing: if "1" in ["1 2"]: ..so it doesn't work for lists of more than one element.
Patch sent to the list with a fix.
Fixed by http://selenic.com/repo/hg/rev/d8fb835376d1 Durham Goode <durham@fb.com> templates: fix ifcontains against sets with length > 1 (issue4259) Previously the ifcontains revset was checking against the set using a pure __contains__ check. It turns out the set was actually a list of formatted strings meant for ui output, which meant the contains check failed if the formatted string wasn't significantly different from the raw value. This change makes it check against the raw data, prior to it being formatted. (please test the fix)