annotate tests/test-diff-ignore-whitespace.t @ 26206:ab1c6e4efda4

add: pass full=False to dirstate walk Previously cmdutil.add would call wctx.walk(), which under the hood calls dirstate.walk with full=True. This means it returns all of the clean files (which we don't need when computing the add set), as well as the unclean files. This results in 1) a lot more work being done and 2) this code path circumventing the hgwatchman extension, resulting in worse performance in hgwatchman environments ('hg add .' went from 9s to 1.8s).
author Durham Goode <durham@fb.com>
date Wed, 09 Sep 2015 09:07:27 -0700
parents 405b6bd015df
children da07367d683b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
1 GNU diff is the reference for all of these results.
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
2
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
3 Prepare tests:
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
4
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
5 $ echo '[alias]' >> $HGRCPATH
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
6 $ echo 'ndiff = diff --nodates' >> $HGRCPATH
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
7
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
8 $ hg init
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
9 $ printf 'hello world\ngoodbye world\n' >foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
10 $ hg ci -Amfoo -ufoo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
11 adding foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
12
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
13
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
14 Test added blank lines:
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
15
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
16 $ printf '\nhello world\n\ngoodbye world\n\n' >foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
17
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
18 >>> two diffs showing three added lines <<<
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
19
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
20 $ hg ndiff
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
21 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
22 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
23 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
24 @@ -1,2 +1,5 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
25 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
26 hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
27 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
28 goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
29 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
30 $ hg ndiff -b
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
31 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
32 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
33 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
34 @@ -1,2 +1,5 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
35 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
36 hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
37 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
38 goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
39 +
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
40
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
41 >>> no diffs <<<
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
42
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
43 $ hg ndiff -B
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
44 $ hg ndiff -Bb
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
45
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
46
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
47 Test added horizontal space first on a line():
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
48
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
49 $ printf '\t hello world\ngoodbye world\n' >foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
50
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
51 >>> four diffs showing added space first on the first line <<<
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
52
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
53 $ hg ndiff
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
54 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
55 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
56 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
57 @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
58 -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
59 + hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
60 goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
61
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
62 $ hg ndiff -b
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
63 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
64 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
65 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
66 @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
67 -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
68 + hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
69 goodbye world
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
70
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
71 $ hg ndiff -B
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
72 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
73 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
74 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
75 @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
76 -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
77 + hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
78 goodbye world
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
79
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
80 $ hg ndiff -Bb
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
81 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
82 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
83 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
84 @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
85 -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
86 + hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
87 goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
88
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
89
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
90 Test added horizontal space last on a line:
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
91
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
92 $ printf 'hello world\t \ngoodbye world\n' >foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
93
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
94 >>> two diffs showing space appended to the first line <<<
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
95
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
96 $ hg ndiff
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
97 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
98 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
99 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
100 @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
101 -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
102 +hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
103 goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
104
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
105 $ hg ndiff -B
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
106 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
107 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
108 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
109 @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
110 -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
111 +hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
112 goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
113
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
114 >>> no diffs <<<
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
115
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
116 $ hg ndiff -b
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
117 $ hg ndiff -Bb
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
118
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
119
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
120 Test added horizontal space in the middle of a word:
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
121
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
122 $ printf 'hello world\ngood bye world\n' >foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
123
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
124 >>> four diffs showing space inserted into "goodbye" <<<
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
125
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
126 $ hg ndiff
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
127 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
128 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
129 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
130 @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
131 hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
132 -goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
133 +good bye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
134
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
135 $ hg ndiff -B
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
136 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
137 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
138 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
139 @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
140 hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
141 -goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
142 +good bye world
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
143
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
144 $ hg ndiff -b
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
145 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
146 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
147 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
148 @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
149 hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
150 -goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
151 +good bye world
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
152
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
153 $ hg ndiff -Bb
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
154 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
155 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
156 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
157 @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
158 hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
159 -goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
160 +good bye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
161
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
162
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
163 Test increased horizontal whitespace amount:
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
164
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
165 $ printf 'hello world\ngoodbye\t\t \tworld\n' >foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
166
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
167 >>> two diffs showing changed whitespace amount in the last line <<<
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
168
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
169 $ hg ndiff
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
170 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
171 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
172 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
173 @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
174 hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
175 -goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
176 +goodbye world
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
177
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
178 $ hg ndiff -B
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
179 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
180 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
181 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
182 @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
183 hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
184 -goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
185 +goodbye world
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
186
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
187 >>> no diffs <<<
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
188
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
189 $ hg ndiff -b
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
190 $ hg ndiff -Bb
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
191
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
192
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
193 Test added blank line with horizontal whitespace:
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
194
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
195 $ printf 'hello world\n \t\ngoodbye world\n' >foo
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
196
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
197 >>> three diffs showing added blank line with horizontal space <<<
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
198
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
199 $ hg ndiff
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
200 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
201 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
202 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
203 @@ -1,2 +1,3 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
204 hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
205 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
206 goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
207
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
208 $ hg ndiff -B
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
209 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
210 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
211 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
212 @@ -1,2 +1,3 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
213 hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
214 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
215 goodbye world
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
216
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
217 $ hg ndiff -b
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
218 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
219 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
220 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
221 @@ -1,2 +1,3 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
222 hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
223 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
224 goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
225
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
226 >>> no diffs <<<
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
227
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
228 $ hg ndiff -Bb
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
229
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
230
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
231 Test added blank line with other whitespace:
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
232
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
233 $ printf 'hello world\n \t\ngoodbye world \n' >foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
234
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
235 >>> three diffs showing added blank line with other space <<<
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
236
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
237 $ hg ndiff
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
238 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
239 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
240 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
241 @@ -1,2 +1,3 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
242 -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
243 -goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
244 +hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
245 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
246 +goodbye world
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
247
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
248 $ hg ndiff -B
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
249 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
250 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
251 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
252 @@ -1,2 +1,3 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
253 -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
254 -goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
255 +hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
256 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
257 +goodbye world
4878
372d93f03d3a diff: correctly handle combinations of whitespace options
Matt Mackall <mpm@selenic.com>
parents: 3199
diff changeset
258
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
259 $ hg ndiff -b
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
260 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
261 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
262 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
263 @@ -1,2 +1,3 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
264 hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
265 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
266 goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
267
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
268 >>> no diffs <<<
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
269
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
270 $ hg ndiff -Bb
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
271
4878
372d93f03d3a diff: correctly handle combinations of whitespace options
Matt Mackall <mpm@selenic.com>
parents: 3199
diff changeset
272
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
273 Test whitespace changes:
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
274
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
275 $ printf 'helloworld\ngoodbye\tworld \n' >foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
276
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
277 >>> four diffs showing changed whitespace <<<
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
278
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
279 $ hg ndiff
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
280 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
281 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
282 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
283 @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
284 -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
285 -goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
286 +helloworld
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
287 +goodbye world
4878
372d93f03d3a diff: correctly handle combinations of whitespace options
Matt Mackall <mpm@selenic.com>
parents: 3199
diff changeset
288
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
289 $ hg ndiff -B
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
290 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
291 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
292 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
293 @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
294 -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
295 -goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
296 +helloworld
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
297 +goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
298
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
299 $ hg ndiff -b
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
300 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
301 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
302 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
303 @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
304 -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
305 +helloworld
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
306 goodbye world
4878
372d93f03d3a diff: correctly handle combinations of whitespace options
Matt Mackall <mpm@selenic.com>
parents: 3199
diff changeset
307
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
308 $ hg ndiff -Bb
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
309 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
310 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
311 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
312 @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
313 -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
314 +helloworld
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
315 goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
316
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
317 >>> no diffs <<<
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
318
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
319 $ hg ndiff -w
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
320
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
321
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
322 Test whitespace changes and blank lines:
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
323
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
324 $ printf 'helloworld\n\n\n\ngoodbye\tworld \n' >foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
325
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
326 >>> five diffs showing changed whitespace <<<
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
327
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
328 $ hg ndiff
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
329 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
330 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
331 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
332 @@ -1,2 +1,5 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
333 -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
334 -goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
335 +helloworld
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
336 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
337 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
338 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
339 +goodbye world
4878
372d93f03d3a diff: correctly handle combinations of whitespace options
Matt Mackall <mpm@selenic.com>
parents: 3199
diff changeset
340
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
341 $ hg ndiff -B
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
342 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
343 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
344 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
345 @@ -1,2 +1,5 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
346 -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
347 -goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
348 +helloworld
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
349 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
350 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
351 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
352 +goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
353
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
354 $ hg ndiff -b
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
355 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
356 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
357 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
358 @@ -1,2 +1,5 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
359 -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
360 +helloworld
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
361 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
362 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
363 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
364 goodbye world
4878
372d93f03d3a diff: correctly handle combinations of whitespace options
Matt Mackall <mpm@selenic.com>
parents: 3199
diff changeset
365
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
366 $ hg ndiff -Bb
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
367 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
368 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
369 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
370 @@ -1,2 +1,5 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
371 -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
372 +helloworld
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
373 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
374 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
375 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
376 goodbye world
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
377
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
378 $ hg ndiff -w
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
379 diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
380 --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
381 +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
382 @@ -1,2 +1,5 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
383 hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
384 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
385 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
386 +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
387 goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
388
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
389 >>> no diffs <<<
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
390
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
391 $ hg ndiff -wB
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
392
12751
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
393
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
394 Test \r (carriage return) as used in "DOS" line endings:
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
395
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
396 $ printf 'hello world\r\n\r\ngoodbye\rworld\n' >foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
397
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
398 $ hg ndiff
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
399 diff -r 540c40a65b78 foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
400 --- a/foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
401 +++ b/foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
402 @@ -1,2 +1,3 @@
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
403 -hello world
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
404 -goodbye world
12942
05fffd665170 tests: use (esc) for all non-ASCII test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12751
diff changeset
405 +hello world\r (esc)
05fffd665170 tests: use (esc) for all non-ASCII test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12751
diff changeset
406 +\r (esc)
17742
405b6bd015df run-tests: allow test output lines to be terminated with \r in addition to \n
Mads Kiilerich <mads@kiilerich.com>
parents: 16089
diff changeset
407 +goodbye\r (no-eol) (esc)
405b6bd015df run-tests: allow test output lines to be terminated with \r in addition to \n
Mads Kiilerich <mads@kiilerich.com>
parents: 16089
diff changeset
408 world
12751
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
409
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
410 No completely blank lines to ignore:
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
411
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
412 $ hg ndiff --ignore-blank-lines
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
413 diff -r 540c40a65b78 foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
414 --- a/foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
415 +++ b/foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
416 @@ -1,2 +1,3 @@
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
417 -hello world
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
418 -goodbye world
12942
05fffd665170 tests: use (esc) for all non-ASCII test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12751
diff changeset
419 +hello world\r (esc)
05fffd665170 tests: use (esc) for all non-ASCII test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12751
diff changeset
420 +\r (esc)
17742
405b6bd015df run-tests: allow test output lines to be terminated with \r in addition to \n
Mads Kiilerich <mads@kiilerich.com>
parents: 16089
diff changeset
421 +goodbye\r (no-eol) (esc)
405b6bd015df run-tests: allow test output lines to be terminated with \r in addition to \n
Mads Kiilerich <mads@kiilerich.com>
parents: 16089
diff changeset
422 world
12751
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
423
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
424 Only new line noticed:
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
425
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
426 $ hg ndiff --ignore-space-change
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
427 diff -r 540c40a65b78 foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
428 --- a/foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
429 +++ b/foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
430 @@ -1,2 +1,3 @@
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
431 hello world
12942
05fffd665170 tests: use (esc) for all non-ASCII test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12751
diff changeset
432 +\r (esc)
12751
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
433 goodbye world
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
434
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
435 $ hg ndiff --ignore-all-space
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
436 diff -r 540c40a65b78 foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
437 --- a/foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
438 +++ b/foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
439 @@ -1,2 +1,3 @@
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
440 hello world
12942
05fffd665170 tests: use (esc) for all non-ASCII test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12751
diff changeset
441 +\r (esc)
12751
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
442 goodbye world
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
443
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
444 New line not noticed when space change ignored:
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
445
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
446 $ hg ndiff --ignore-blank-lines --ignore-all-space
15509
3774e1453ef4 diff: --ignore-blank-lines was too enthusiastic
Patrick Mezard <pmezard@gmail.com>
parents: 12942
diff changeset
447
3774e1453ef4 diff: --ignore-blank-lines was too enthusiastic
Patrick Mezard <pmezard@gmail.com>
parents: 12942
diff changeset
448 Do not ignore all newlines, only blank lines
3774e1453ef4 diff: --ignore-blank-lines was too enthusiastic
Patrick Mezard <pmezard@gmail.com>
parents: 12942
diff changeset
449
3774e1453ef4 diff: --ignore-blank-lines was too enthusiastic
Patrick Mezard <pmezard@gmail.com>
parents: 12942
diff changeset
450 $ printf 'hello \nworld\ngoodbye world\n' > foo
3774e1453ef4 diff: --ignore-blank-lines was too enthusiastic
Patrick Mezard <pmezard@gmail.com>
parents: 12942
diff changeset
451 $ hg ndiff --ignore-blank-lines
3774e1453ef4 diff: --ignore-blank-lines was too enthusiastic
Patrick Mezard <pmezard@gmail.com>
parents: 12942
diff changeset
452 diff -r 540c40a65b78 foo
3774e1453ef4 diff: --ignore-blank-lines was too enthusiastic
Patrick Mezard <pmezard@gmail.com>
parents: 12942
diff changeset
453 --- a/foo
3774e1453ef4 diff: --ignore-blank-lines was too enthusiastic
Patrick Mezard <pmezard@gmail.com>
parents: 12942
diff changeset
454 +++ b/foo
3774e1453ef4 diff: --ignore-blank-lines was too enthusiastic
Patrick Mezard <pmezard@gmail.com>
parents: 12942
diff changeset
455 @@ -1,2 +1,3 @@
3774e1453ef4 diff: --ignore-blank-lines was too enthusiastic
Patrick Mezard <pmezard@gmail.com>
parents: 12942
diff changeset
456 -hello world
3774e1453ef4 diff: --ignore-blank-lines was too enthusiastic
Patrick Mezard <pmezard@gmail.com>
parents: 12942
diff changeset
457 +hello
3774e1453ef4 diff: --ignore-blank-lines was too enthusiastic
Patrick Mezard <pmezard@gmail.com>
parents: 12942
diff changeset
458 +world
3774e1453ef4 diff: --ignore-blank-lines was too enthusiastic
Patrick Mezard <pmezard@gmail.com>
parents: 12942
diff changeset
459 goodbye world
16089
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
460
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
461 Test hunk offsets adjustments with --ignore-blank-lines
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
462
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
463 $ hg revert -aC
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
464 reverting foo
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
465 $ printf '\nb\nx\nd\n' > a
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
466 $ printf 'b\ny\nd\n' > b
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
467 $ hg add a b
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
468 $ hg ci -m add
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
469 $ hg cat -r . a > b
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
470 $ hg cat -r . b > a
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
471 $ hg diff -B --nodates a > ../diffa
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
472 $ cat ../diffa
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
473 diff -r 0e66aa54f318 a
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
474 --- a/a
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
475 +++ b/a
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
476 @@ -1,4 +1,4 @@
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
477
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
478 b
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
479 -x
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
480 +y
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
481 d
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
482 $ hg diff -B --nodates b > ../diffb
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
483 $ cat ../diffb
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
484 diff -r 0e66aa54f318 b
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
485 --- a/b
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
486 +++ b/b
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
487 @@ -1,3 +1,3 @@
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
488 b
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
489 -y
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
490 +x
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
491 d
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
492 $ hg revert -aC
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
493 reverting a
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
494 reverting b
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
495 $ hg import --no-commit ../diffa
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
496 applying ../diffa
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
497 $ hg revert -aC
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
498 reverting a
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
499 $ hg import --no-commit ../diffb
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
500 applying ../diffb
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
501 $ hg revert -aC
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
502 reverting b