tests/test-diff-ignore-whitespace.t
author Raphaël Gomès <rgomes@octobus.net>
Mon, 22 Jul 2024 16:49:38 +0200
changeset 51699 bd1483fd7088
parent 49621 55c6ebd11cb9
permissions -rw-r--r--
Latest image and pytype fix
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 34013
diff changeset
     8
  $ hg init repo
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 34013
diff changeset
     9
  $ cd repo
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    10
  $ printf 'hello world\ngoodbye world\n' >foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    11
  $ hg ci -Amfoo -ufoo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    12
  adding foo
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
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    15
Test added blank lines:
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    16
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    17
  $ 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
    18
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    19
>>> two diffs showing three added lines <<<
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    20
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    21
  $ hg ndiff
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    22
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    23
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    24
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    25
  @@ -1,2 +1,5 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    26
  +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    27
   hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    28
  +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    29
   goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    30
  +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    31
  $ hg ndiff -b
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    32
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    33
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    34
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    35
  @@ -1,2 +1,5 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    36
  +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    37
   hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    38
  +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    39
   goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    40
  +
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    41
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    42
>>> no diffs <<<
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    43
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    44
  $ hg ndiff -B
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    45
  $ hg ndiff -Bb
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    46
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    47
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    48
Test added horizontal space first on a line():
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    49
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    50
  $ printf '\t hello world\ngoodbye world\n' >foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    51
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    52
>>> 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
    53
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    54
  $ hg ndiff
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    55
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    56
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    57
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    58
  @@ -1,2 +1,2 @@
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
  +	 hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    61
   goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    62
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    63
  $ hg ndiff -b
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    64
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    65
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    66
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    67
  @@ -1,2 +1,2 @@
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
  +	 hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    70
   goodbye world
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    71
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    72
  $ hg ndiff -B
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    73
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    74
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    75
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    76
  @@ -1,2 +1,2 @@
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
  +	 hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    79
   goodbye world
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    80
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    81
  $ hg ndiff -Bb
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    82
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    83
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    84
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    85
  @@ -1,2 +1,2 @@
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
  +	 hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    88
   goodbye world
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
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    91
Test added horizontal space last on a line:
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    92
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    93
  $ printf 'hello world\t \ngoodbye world\n' >foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    94
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    95
>>> 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
    96
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    97
  $ hg ndiff
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    98
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    99
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   100
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   101
  @@ -1,2 +1,2 @@
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
  +hello world	 
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   104
   goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   105
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   106
  $ hg ndiff -B
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   107
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   108
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   109
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   110
  @@ -1,2 +1,2 @@
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
  +hello world	 
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   113
   goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   114
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   115
>>> no diffs <<<
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   116
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   117
  $ hg ndiff -b
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   118
  $ hg ndiff -Bb
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   119
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
   120
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   121
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
   122
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   123
  $ printf 'hello world\ngood bye world\n' >foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   124
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   125
>>> 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
   126
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   127
  $ hg ndiff
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   128
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   129
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   130
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   131
  @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   132
   hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   133
  -goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   134
  +good bye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   135
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   136
  $ hg ndiff -B
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   137
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   138
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   139
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   140
  @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   141
   hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   142
  -goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   143
  +good bye world
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
   144
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   145
  $ hg ndiff -b
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   146
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   147
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   148
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   149
  @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   150
   hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   151
  -goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   152
  +good bye world
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
   153
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   154
  $ hg ndiff -Bb
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   155
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   156
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   157
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   158
  @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   159
   hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   160
  -goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   161
  +good bye world
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
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   164
Test increased horizontal whitespace amount:
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   165
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   166
  $ 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
   167
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   168
>>> 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
   169
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   170
  $ hg ndiff
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   171
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   172
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   173
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   174
  @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   175
   hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   176
  -goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   177
  +goodbye		  	world
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
   178
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   179
  $ hg ndiff -B
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   180
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   181
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   182
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   183
  @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   184
   hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   185
  -goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   186
  +goodbye		  	world
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
   187
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   188
>>> no diffs <<<
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   189
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   190
  $ hg ndiff -b
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   191
  $ hg ndiff -Bb
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
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   194
Test added blank line with horizontal whitespace:
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   195
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   196
  $ 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
   197
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   198
>>> 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
   199
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   200
  $ hg ndiff
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   201
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   202
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   203
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   204
  @@ -1,2 +1,3 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   205
   hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   206
  + 	
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   207
   goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   208
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   209
  $ hg ndiff -B
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   210
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   211
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   212
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   213
  @@ -1,2 +1,3 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   214
   hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   215
  + 	
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   216
   goodbye world
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
   217
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   218
  $ hg ndiff -b
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   219
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   220
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   221
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   222
  @@ -1,2 +1,3 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   223
   hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   224
  + 	
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   225
   goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   226
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   227
>>> no diffs <<<
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   228
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   229
  $ hg ndiff -Bb
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
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   232
Test added blank line with other whitespace:
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   233
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   234
  $ 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
   235
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   236
>>> 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
   237
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   238
  $ hg ndiff
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   239
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   240
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   241
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   242
  @@ -1,2 +1,3 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   243
  -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   244
  -goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   245
  +hello  world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   246
  + 	
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   247
  +goodbye world 
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
   248
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   249
  $ hg ndiff -B
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   250
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   251
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   252
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   253
  @@ -1,2 +1,3 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   254
  -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   255
  -goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   256
  +hello  world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   257
  + 	
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   258
  +goodbye world 
4878
372d93f03d3a diff: correctly handle combinations of whitespace options
Matt Mackall <mpm@selenic.com>
parents: 3199
diff changeset
   259
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   260
  $ hg ndiff -b
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   261
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   262
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   263
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   264
  @@ -1,2 +1,3 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   265
   hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   266
  + 	
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   267
   goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   268
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   269
>>> no diffs <<<
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   270
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   271
  $ hg ndiff -Bb
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   272
4878
372d93f03d3a diff: correctly handle combinations of whitespace options
Matt Mackall <mpm@selenic.com>
parents: 3199
diff changeset
   273
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   274
Test whitespace changes:
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   275
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   276
  $ printf 'helloworld\ngoodbye\tworld \n' >foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   277
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   278
>>> four diffs showing changed whitespace <<<
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   279
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   280
  $ hg ndiff
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   281
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   282
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   283
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   284
  @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   285
  -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   286
  -goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   287
  +helloworld
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   288
  +goodbye	world 
4878
372d93f03d3a diff: correctly handle combinations of whitespace options
Matt Mackall <mpm@selenic.com>
parents: 3199
diff changeset
   289
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   290
  $ hg ndiff -B
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   291
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   292
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   293
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   294
  @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   295
  -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   296
  -goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   297
  +helloworld
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   298
  +goodbye	world 
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   299
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   300
  $ hg ndiff -b
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   301
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   302
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   303
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   304
  @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   305
  -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   306
  +helloworld
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   307
   goodbye world
4878
372d93f03d3a diff: correctly handle combinations of whitespace options
Matt Mackall <mpm@selenic.com>
parents: 3199
diff changeset
   308
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   309
  $ hg ndiff -Bb
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   310
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   311
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   312
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   313
  @@ -1,2 +1,2 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   314
  -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   315
  +helloworld
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   316
   goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   317
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   318
>>> no diffs <<<
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   319
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   320
  $ hg ndiff -w
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
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   323
Test whitespace changes and blank lines:
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   324
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   325
  $ 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
   326
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   327
>>> five diffs showing changed whitespace <<<
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   328
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   329
  $ hg ndiff
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   330
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   331
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   332
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   333
  @@ -1,2 +1,5 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   334
  -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   335
  -goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   336
  +helloworld
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
  +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   340
  +goodbye	world 
4878
372d93f03d3a diff: correctly handle combinations of whitespace options
Matt Mackall <mpm@selenic.com>
parents: 3199
diff changeset
   341
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   342
  $ hg ndiff -B
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   343
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   344
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   345
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   346
  @@ -1,2 +1,5 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   347
  -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   348
  -goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   349
  +helloworld
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
  +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   353
  +goodbye	world 
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   354
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   355
  $ hg ndiff -b
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   356
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   357
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   358
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   359
  @@ -1,2 +1,5 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   360
  -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   361
  +helloworld
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
  +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   365
   goodbye world
4878
372d93f03d3a diff: correctly handle combinations of whitespace options
Matt Mackall <mpm@selenic.com>
parents: 3199
diff changeset
   366
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   367
  $ hg ndiff -Bb
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   368
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   369
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   370
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   371
  @@ -1,2 +1,5 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   372
  -hello world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   373
  +helloworld
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
  +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   377
   goodbye world
2594
bdf9d809467c add missed tests for diff -b/-B
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
   378
12138
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   379
  $ hg ndiff -w
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   380
  diff -r 540c40a65b78 foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   381
  --- a/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   382
  +++ b/foo
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   383
  @@ -1,2 +1,5 @@
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   384
   hello world
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
  +
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   388
   goodbye world
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   389
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   390
>>> no diffs <<<
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   391
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   392
  $ hg ndiff -wB
aff0b3947020 tests: unify test-diff-ignore-whitespace
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   393
12751
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   394
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   395
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
   396
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   397
  $ 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
   398
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   399
  $ hg ndiff
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   400
  diff -r 540c40a65b78 foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   401
  --- a/foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   402
  +++ b/foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   403
  @@ -1,2 +1,3 @@
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   404
  -hello world
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   405
  -goodbye world
12942
05fffd665170 tests: use (esc) for all non-ASCII test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12751
diff changeset
   406
  +hello world\r (esc)
05fffd665170 tests: use (esc) for all non-ASCII test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12751
diff changeset
   407
  +\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
   408
  +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
   409
  world
12751
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   410
34013
da07367d683b mdiff: add a --ignore-space-at-eol option
David Soria Parra <davidsp@fb.com>
parents: 17742
diff changeset
   411
Test \r (carriage return) as used in "DOS" line endings:
da07367d683b mdiff: add a --ignore-space-at-eol option
David Soria Parra <davidsp@fb.com>
parents: 17742
diff changeset
   412
da07367d683b mdiff: add a --ignore-space-at-eol option
David Soria Parra <davidsp@fb.com>
parents: 17742
diff changeset
   413
  $ printf 'hello world    \r\n\t\ngoodbye world\n' >foo
da07367d683b mdiff: add a --ignore-space-at-eol option
David Soria Parra <davidsp@fb.com>
parents: 17742
diff changeset
   414
da07367d683b mdiff: add a --ignore-space-at-eol option
David Soria Parra <davidsp@fb.com>
parents: 17742
diff changeset
   415
  $ hg ndiff --ignore-space-at-eol
da07367d683b mdiff: add a --ignore-space-at-eol option
David Soria Parra <davidsp@fb.com>
parents: 17742
diff changeset
   416
  diff -r 540c40a65b78 foo
da07367d683b mdiff: add a --ignore-space-at-eol option
David Soria Parra <davidsp@fb.com>
parents: 17742
diff changeset
   417
  --- a/foo
da07367d683b mdiff: add a --ignore-space-at-eol option
David Soria Parra <davidsp@fb.com>
parents: 17742
diff changeset
   418
  +++ b/foo
da07367d683b mdiff: add a --ignore-space-at-eol option
David Soria Parra <davidsp@fb.com>
parents: 17742
diff changeset
   419
  @@ -1,2 +1,3 @@
da07367d683b mdiff: add a --ignore-space-at-eol option
David Soria Parra <davidsp@fb.com>
parents: 17742
diff changeset
   420
   hello world
da07367d683b mdiff: add a --ignore-space-at-eol option
David Soria Parra <davidsp@fb.com>
parents: 17742
diff changeset
   421
  +\t (esc)
da07367d683b mdiff: add a --ignore-space-at-eol option
David Soria Parra <davidsp@fb.com>
parents: 17742
diff changeset
   422
   goodbye world
da07367d683b mdiff: add a --ignore-space-at-eol option
David Soria Parra <davidsp@fb.com>
parents: 17742
diff changeset
   423
12751
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   424
No completely blank lines to ignore:
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   425
34013
da07367d683b mdiff: add a --ignore-space-at-eol option
David Soria Parra <davidsp@fb.com>
parents: 17742
diff changeset
   426
  $ printf 'hello world\r\n\r\ngoodbye\rworld\n' >foo
da07367d683b mdiff: add a --ignore-space-at-eol option
David Soria Parra <davidsp@fb.com>
parents: 17742
diff changeset
   427
12751
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   428
  $ hg ndiff --ignore-blank-lines
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   429
  diff -r 540c40a65b78 foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   430
  --- a/foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   431
  +++ b/foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   432
  @@ -1,2 +1,3 @@
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   433
  -hello world
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   434
  -goodbye world
12942
05fffd665170 tests: use (esc) for all non-ASCII test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12751
diff changeset
   435
  +hello world\r (esc)
05fffd665170 tests: use (esc) for all non-ASCII test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12751
diff changeset
   436
  +\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
   437
  +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
   438
  world
12751
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   439
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   440
Only new line noticed:
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   441
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   442
  $ hg ndiff --ignore-space-change
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   443
  diff -r 540c40a65b78 foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   444
  --- a/foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   445
  +++ b/foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   446
  @@ -1,2 +1,3 @@
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   447
   hello world
12942
05fffd665170 tests: use (esc) for all non-ASCII test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12751
diff changeset
   448
  +\r (esc)
12751
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   449
   goodbye world
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   450
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   451
  $ hg ndiff --ignore-all-space
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   452
  diff -r 540c40a65b78 foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   453
  --- a/foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   454
  +++ b/foo
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   455
  @@ -1,2 +1,3 @@
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   456
   hello world
12942
05fffd665170 tests: use (esc) for all non-ASCII test output
Mads Kiilerich <mads@kiilerich.com>
parents: 12751
diff changeset
   457
  +\r (esc)
12751
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   458
   goodbye world
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   459
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   460
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
   461
8eb758ea738c mdiff: carriage return (\r) is also ignorable whitespace
Mads Kiilerich <mads@kiilerich.com>
parents: 12138
diff changeset
   462
  $ 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
   463
3774e1453ef4 diff: --ignore-blank-lines was too enthusiastic
Patrick Mezard <pmezard@gmail.com>
parents: 12942
diff changeset
   464
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
   465
3774e1453ef4 diff: --ignore-blank-lines was too enthusiastic
Patrick Mezard <pmezard@gmail.com>
parents: 12942
diff changeset
   466
  $ printf 'hello \nworld\ngoodbye world\n' > foo
3774e1453ef4 diff: --ignore-blank-lines was too enthusiastic
Patrick Mezard <pmezard@gmail.com>
parents: 12942
diff changeset
   467
  $ hg ndiff --ignore-blank-lines
3774e1453ef4 diff: --ignore-blank-lines was too enthusiastic
Patrick Mezard <pmezard@gmail.com>
parents: 12942
diff changeset
   468
  diff -r 540c40a65b78 foo
3774e1453ef4 diff: --ignore-blank-lines was too enthusiastic
Patrick Mezard <pmezard@gmail.com>
parents: 12942
diff changeset
   469
  --- a/foo
3774e1453ef4 diff: --ignore-blank-lines was too enthusiastic
Patrick Mezard <pmezard@gmail.com>
parents: 12942
diff changeset
   470
  +++ b/foo
3774e1453ef4 diff: --ignore-blank-lines was too enthusiastic
Patrick Mezard <pmezard@gmail.com>
parents: 12942
diff changeset
   471
  @@ -1,2 +1,3 @@
3774e1453ef4 diff: --ignore-blank-lines was too enthusiastic
Patrick Mezard <pmezard@gmail.com>
parents: 12942
diff changeset
   472
  -hello world
3774e1453ef4 diff: --ignore-blank-lines was too enthusiastic
Patrick Mezard <pmezard@gmail.com>
parents: 12942
diff changeset
   473
  +hello 
3774e1453ef4 diff: --ignore-blank-lines was too enthusiastic
Patrick Mezard <pmezard@gmail.com>
parents: 12942
diff changeset
   474
  +world
3774e1453ef4 diff: --ignore-blank-lines was too enthusiastic
Patrick Mezard <pmezard@gmail.com>
parents: 12942
diff changeset
   475
   goodbye world
16089
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   476
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   477
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
   478
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   479
  $ hg revert -aC
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   480
  reverting foo
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   481
  $ 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
   482
  $ 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
   483
  $ hg add a b
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   484
  $ hg ci -m add
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   485
  $ hg cat -r . a > b
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   486
  $ hg cat -r . b > a
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   487
  $ 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
   488
  $ cat ../diffa
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   489
  diff -r 0e66aa54f318 a
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   490
  --- a/a
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   491
  +++ b/a
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   492
  @@ -1,4 +1,4 @@
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   493
   
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   494
   b
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   495
  -x
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   496
  +y
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   497
   d
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   498
  $ 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
   499
  $ cat ../diffb
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   500
  diff -r 0e66aa54f318 b
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   501
  --- a/b
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   502
  +++ b/b
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   503
  @@ -1,3 +1,3 @@
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   504
   b
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   505
  -y
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   506
  +x
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   507
   d
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   508
  $ hg revert -aC
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   509
  reverting a
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   510
  reverting b
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   511
  $ hg import --no-commit ../diffa
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   512
  applying ../diffa
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   513
  $ hg revert -aC
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   514
  reverting a
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   515
  $ hg import --no-commit ../diffb
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   516
  applying ../diffb
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   517
  $ hg revert -aC
2e8f4b82c551 mdiff: adjust hunk offsets with --ignore-blank-lines (issue3234)
Patrick Mezard <patrick@mezard.eu>
parents: 15509
diff changeset
   518
  reverting b