Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
21229:54d7657d7d1e | 21540:d8fb835376d1 |
---|---|
1817 $ hg log --template '{rev} {ifcontains(rev, revset("."), "current rev", "not current rev")}\n' | 1817 $ hg log --template '{rev} {ifcontains(rev, revset("."), "current rev", "not current rev")}\n' |
1818 2 current rev | 1818 2 current rev |
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 |
1825 0 Parents: | 1830 0 Parents: |
1826 | 1831 |