Mercurial > public > mercurial-scm > hg
diff tests/test-diff-ignore-whitespace.out @ 9827:4fe9ca519637
mdiff: fix diff -b/B/w on mixed whitespace hunks (issue127)
Previous code was computing hunks then checking if these hunks could be ignored
when taking whitespace/blank-lines options in accounts. This approach is simple
but fails with hunks containing both whitespace and non-whitespace changes, the
whole hunk is emitted while it can be mostly made of whitespace. The new
version normalize the whitespaces before hunk generation, and test for
blank-lines afterwards.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Wed, 11 Nov 2009 18:31:42 +0100 |
parents | 3d1f9dcecdea |
children |
line wrap: on
line diff
--- a/tests/test-diff-ignore-whitespace.out Wed Nov 11 17:02:00 2009 +0100 +++ b/tests/test-diff-ignore-whitespace.out Wed Nov 11 18:31:42 2009 +0100 @@ -181,11 +181,9 @@ --- a/foo +++ b/foo @@ -1,2 +1,3 @@ --hello world --goodbye world -+hello world + hello world + -+goodbye world + goodbye world hg diff -Bb >>> four diffs showing changed whitespace <<< hg diff @@ -212,18 +210,16 @@ +++ b/foo @@ -1,2 +1,2 @@ -hello world --goodbye world +helloworld -+goodbye world + goodbye world hg diff -Bb diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,2 @@ -hello world --goodbye world +helloworld -+goodbye world + goodbye world hg diff -w >>> five diffs showing changed whitespace <<< hg diff @@ -256,34 +252,30 @@ +++ b/foo @@ -1,2 +1,5 @@ -hello world --goodbye world +helloworld + + + -+goodbye world + goodbye world hg diff -Bb diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,5 @@ -hello world --goodbye world +helloworld + + + -+goodbye world + goodbye world hg diff -w diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,5 @@ --hello world --goodbye world -+helloworld + hello world + + + -+goodbye world + goodbye world hg diff -wB