diff tests/test-command-template.t @ 21540:d8fb835376d1 stable

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.
author Durham Goode <durham@fb.com>
date Fri, 23 May 2014 16:25:55 -0700
parents 7731a2281cf0
children cce404b0c918
line wrap: on
line diff
--- a/tests/test-command-template.t
+++ b/tests/test-command-template.t
@@ -1819,6 +1819,11 @@
   1 not current rev
   0 not current rev
 
+  $ hg log --template '{rev} {ifcontains(rev, revset(". + .^"), "match rev", "not match rev")}\n'
+  2 match rev
+  1 match rev
+  0 not match rev
+
   $ hg log --template '{rev} Parents: {revset("parents(%s)", rev)}\n'
   2 Parents: 1
   1 Parents: 0