tests/test-diff-change.t
author Brodie Rao <brodie@bitheap.org>
Wed, 22 Sep 2010 16:05:59 -0500
changeset 12373 58885f00b998
parent 12136 30b5e83004e0
child 16487 4fe874697a4d
permissions -rw-r--r--
tests: don't match blank output lines as regexes in unified tests Currently, the following unified test will pass: $ echo foo A blank output line (a line containing just two spaces) will match any output. The patch modifies the unified test runner to ignore empty strings strings when do regular expression matching.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
     1
Testing diff --change
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
     2
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
     3
  $ hg init a
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
     4
  $ cd a
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
     5
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
     6
  $ echo "first" > file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
     7
  $ hg add file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
     8
  $ hg commit -m 'first commit' # 0
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
     9
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    10
  $ echo "second" > file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    11
  $ hg commit -m 'second commit' # 1
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    12
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    13
  $ echo "third" > file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    14
  $ hg commit -m 'third commit' # 2
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
    15
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    16
  $ hg diff --nodates --change 1
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    17
  diff -r 4bb65dda5db4 -r e9b286083166 file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    18
  --- a/file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    19
  +++ b/file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    20
  @@ -1,1 +1,1 @@
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    21
  -first
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    22
  +second
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
    23
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    24
  $ hg diff --change e9b286083166
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    25
  diff -r 4bb65dda5db4 -r e9b286083166 file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    26
  --- a/file.txt	Thu Jan 01 00:00:00 1970 +0000
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    27
  +++ b/file.txt	Thu Jan 01 00:00:00 1970 +0000
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    28
  @@ -1,1 +1,1 @@
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    29
  -first
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    30
  +second
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
    31
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
    32
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    33
Testing diff --change when merge:
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
    34
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    35
  $ for i in 1 2 3 4 5 6 7 8 9 10; do
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    36
  $    echo $i >> file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    37
  $ done
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    38
  $ hg commit -m "lots of text" # 3
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    39
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    40
  $ sed -e 's,^2$,x,' file.txt > file.txt.tmp
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    41
  $ mv file.txt.tmp file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    42
  $ hg commit -m "change 2 to x" # 4
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
    43
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    44
  $ hg up -r 3
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    45
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    46
  $ sed -e 's,^8$,y,' file.txt > file.txt.tmp
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    47
  $ mv file.txt.tmp file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    48
  $ hg commit -m "change 8 to y"
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    49
  created new head
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
    50
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    51
  $ hg up -C -r 4
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    52
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    53
  $ hg merge -r 5
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    54
  merging file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    55
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    56
  (branch merge, don't forget to commit)
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    57
  $ hg commit -m "merge 8 to y" # 6
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
    58
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    59
  $ hg diff --change 5
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    60
  diff -r ae119d680c82 -r 9085c5c02e52 file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    61
  --- a/file.txt	Thu Jan 01 00:00:00 1970 +0000
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    62
  +++ b/file.txt	Thu Jan 01 00:00:00 1970 +0000
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    63
  @@ -6,6 +6,6 @@
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    64
   5
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    65
   6
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    66
   7
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    67
  -8
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    68
  +y
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    69
   9
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    70
   10
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
    71
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    72
must be similar to 'hg diff --change 5':
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
    73
12136
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    74
  $ hg diff -c 6
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    75
  diff -r 273b50f17c6d -r 979ca961fd2e file.txt
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    76
  --- a/file.txt	Thu Jan 01 00:00:00 1970 +0000
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    77
  +++ b/file.txt	Thu Jan 01 00:00:00 1970 +0000
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    78
  @@ -6,6 +6,6 @@
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    79
   5
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    80
   6
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    81
   7
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    82
  -8
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    83
  +y
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    84
   9
30b5e83004e0 tests: unify test-diff-change
Adrian Buehlmann <adrian@cadifra.com>
parents: 7680
diff changeset
    85
   10
7628
9c6ae2e09e11 diff: add --change option to display single changeset diff (issue1420)
Stepan Koltsov <yozh@mx1.ru>
parents:
diff changeset
    86