Mercurial > hg-stable
diff tests/test-annotate.t @ 15528:a84698badf0b
annotate: support diff whitespace filtering flags (issue3030)
splitblock() was added to handle blocks returned by bdiff.blocks() which differ
only by blank lines but are not made only of blank lines. I do not know exactly
how it could happen but mdiff.blocks() threshold behaviour makes me think it
can if those blocks are made of very popular lines mixed with popular blank
lines. If it is proven to be wrong, the function can be dropped.
The first implementation made annotate share diff configuration entries. But it
looks like users will user -w/b for annotate but not for diff, on both the
command line and hgweb. Since the latter cannot use command line entries, we
introduce a new [annotate] section duplicating the diff whitespace options.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Fri, 18 Nov 2011 12:04:31 +0100 |
parents | bf93e78f2638 |
children | 2c480532f36e |
line wrap: on
line diff
--- a/tests/test-annotate.t Sun Nov 20 19:14:36 2011 +0100 +++ b/tests/test-annotate.t Fri Nov 18 12:04:31 2011 +0100 @@ -2,7 +2,8 @@ init - $ hg init + $ hg init repo + $ cd repo commit @@ -253,3 +254,56 @@ $ hg ann nosuchfile abort: nosuchfile: no such file in rev e9e6b4fa872f [255] + +Test annotate with whitespace options + + $ cd .. + $ hg init repo-ws + $ cd repo-ws + $ cat > a <<EOF + > aa + > + > b b + > EOF + $ hg ci -Am "adda" + adding a + $ cat > a <<EOF + > a a + > + > + > b b + > EOF + $ hg ci -m "changea" + +Annotate with no option + + $ hg annotate a + 1: a a + 0: + 1: + 1: b b + +Annotate with --ignore-space-change + + $ hg annotate --ignore-space-change a + 1: a a + 1: + 0: + 0: b b + +Annotate with --ignore-all-space + + $ hg annotate --ignore-all-space a + 0: a a + 0: + 1: + 0: b b + +Annotate with --ignore-blank-lines (similar to no options case) + + $ hg annotate --ignore-blank-lines a + 1: a a + 0: + 1: + 1: b b +