tests/test-diff-upgrade.t
author Adrian Buehlmann <adrian@cadifra.com>
Thu, 02 Sep 2010 15:39:55 +0200
changeset 12149 3213e56d63aa
parent 11551 tests/test-diff-upgrade@4484a7b661f2
child 12316 4134686b83e1
permissions -rw-r--r--
tests: unify test-diff-upgrade
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12149
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
     1
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
     2
  $ echo "[extensions]" >> $HGRCPATH
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
     3
  $ echo "autodiff=$TESTDIR/autodiff.py" >> $HGRCPATH
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
     4
  $ echo "[diff]" >> $HGRCPATH
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
     5
  $ echo "nodates=1" >> $HGRCPATH
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
     6
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
     7
  $ hg init repo
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
     8
  $ cd repo
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
     9
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    10
make a combination of new, changed and deleted file
10189
e451e599fbcf patch: support diff data loss detection and upgrade
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    11
12149
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    12
  $ echo regular > regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    13
  $ echo rmregular > rmregular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    14
  $ touch rmempty
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    15
  $ echo exec > exec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    16
  $ chmod +x exec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    17
  $ echo rmexec > rmexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    18
  $ chmod +x rmexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    19
  $ echo setexec > setexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    20
  $ echo unsetexec > unsetexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    21
  $ chmod +x unsetexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    22
  $ echo binary > binary
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    23
  $ python -c "file('rmbinary', 'wb').write('\0')"
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    24
  $ hg ci -Am addfiles
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    25
  adding binary
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    26
  adding exec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    27
  adding regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    28
  adding rmbinary
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    29
  adding rmempty
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    30
  adding rmexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    31
  adding rmregular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    32
  adding setexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    33
  adding unsetexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    34
  $ echo regular >> regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    35
  $ echo newregular >> newregular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    36
  $ rm rmempty
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    37
  $ touch newempty
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    38
  $ rm rmregular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    39
  $ echo exec >> exec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    40
  $ echo newexec > newexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    41
  $ chmod +x newexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    42
  $ rm rmexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    43
  $ chmod +x setexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    44
  $ chmod -x unsetexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    45
  $ python -c "file('binary', 'wb').write('\0\0')"
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    46
  $ python -c "file('newbinary', 'wb').write('\0')"
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    47
  $ rm rmbinary
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    48
  $ hg addremove -s 0
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    49
  adding newbinary
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    50
  adding newempty
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    51
  adding newexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    52
  adding newregular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    53
  removing rmbinary
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    54
  removing rmempty
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    55
  removing rmexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    56
  removing rmregular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    57
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    58
git=no: regular diff for all files
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    59
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    60
  $ hg autodiff --git=no
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    61
  diff -r b3f053cd7c7f binary
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    62
  Binary file binary has changed
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    63
  diff -r b3f053cd7c7f exec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    64
  --- a/exec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    65
  +++ b/exec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    66
  @@ -1,1 +1,2 @@
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    67
   exec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    68
  +exec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    69
  diff -r b3f053cd7c7f newbinary
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    70
  Binary file newbinary has changed
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    71
  diff -r b3f053cd7c7f newexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    72
  --- /dev/null
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    73
  +++ b/newexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    74
  @@ -0,0 +1,1 @@
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    75
  +newexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    76
  diff -r b3f053cd7c7f newregular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    77
  --- /dev/null
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    78
  +++ b/newregular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    79
  @@ -0,0 +1,1 @@
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    80
  +newregular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    81
  diff -r b3f053cd7c7f regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    82
  --- a/regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    83
  +++ b/regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    84
  @@ -1,1 +1,2 @@
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    85
   regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    86
  +regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    87
  diff -r b3f053cd7c7f rmbinary
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    88
  Binary file rmbinary has changed
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    89
  diff -r b3f053cd7c7f rmexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    90
  --- a/rmexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    91
  +++ /dev/null
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    92
  @@ -1,1 +0,0 @@
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    93
  -rmexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    94
  diff -r b3f053cd7c7f rmregular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    95
  --- a/rmregular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    96
  +++ /dev/null
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    97
  @@ -1,1 +0,0 @@
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    98
  -rmregular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
    99
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   100
git=yes: git diff for single regular file
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   101
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   102
  $ hg autodiff --git=yes regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   103
  diff --git a/regular b/regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   104
  --- a/regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   105
  +++ b/regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   106
  @@ -1,1 +1,2 @@
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   107
   regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   108
  +regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   109
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   110
git=auto: regular diff for regular files and removals
10189
e451e599fbcf patch: support diff data loss detection and upgrade
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   111
12149
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   112
  $ hg autodiff --git=auto regular newregular rmregular rmbinary rmexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   113
  diff -r b3f053cd7c7f newregular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   114
  --- /dev/null
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   115
  +++ b/newregular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   116
  @@ -0,0 +1,1 @@
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   117
  +newregular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   118
  diff -r b3f053cd7c7f regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   119
  --- a/regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   120
  +++ b/regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   121
  @@ -1,1 +1,2 @@
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   122
   regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   123
  +regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   124
  diff -r b3f053cd7c7f rmbinary
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   125
  Binary file rmbinary has changed
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   126
  diff -r b3f053cd7c7f rmexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   127
  --- a/rmexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   128
  +++ /dev/null
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   129
  @@ -1,1 +0,0 @@
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   130
  -rmexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   131
  diff -r b3f053cd7c7f rmregular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   132
  --- a/rmregular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   133
  +++ /dev/null
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   134
  @@ -1,1 +0,0 @@
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   135
  -rmregular
10189
e451e599fbcf patch: support diff data loss detection and upgrade
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   136
12149
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   137
  $ for f in exec newexec setexec unsetexec binary newbinary newempty rmempty; do
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   138
  >     echo
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   139
  >     echo '% git=auto: git diff for' $f
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   140
  >     hg autodiff --git=auto $f
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   141
  > done
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   142
  
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   143
  % git=auto: git diff for exec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   144
  diff -r b3f053cd7c7f exec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   145
  --- a/exec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   146
  +++ b/exec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   147
  @@ -1,1 +1,2 @@
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   148
   exec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   149
  +exec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   150
  
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   151
  % git=auto: git diff for newexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   152
  diff --git a/newexec b/newexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   153
  new file mode 100755
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   154
  --- /dev/null
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   155
  +++ b/newexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   156
  @@ -0,0 +1,1 @@
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   157
  +newexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   158
  
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   159
  % git=auto: git diff for setexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   160
  diff --git a/setexec b/setexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   161
  old mode 100644
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   162
  new mode 100755
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   163
  
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   164
  % git=auto: git diff for unsetexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   165
  diff --git a/unsetexec b/unsetexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   166
  old mode 100755
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   167
  new mode 100644
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   168
  
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   169
  % git=auto: git diff for binary
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   170
  diff --git a/binary b/binary
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   171
  index a9128c283485202893f5af379dd9beccb6e79486..09f370e38f498a462e1ca0faa724559b6630c04f
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   172
  GIT binary patch
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   173
  literal 2
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   174
  Jc${Nk0000200961
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   175
  
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   176
  
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   177
  % git=auto: git diff for newbinary
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   178
  diff --git a/newbinary b/newbinary
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   179
  new file mode 100644
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   180
  index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   181
  GIT binary patch
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   182
  literal 1
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   183
  Ic${MZ000310RR91
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   184
  
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   185
  
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   186
  % git=auto: git diff for newempty
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   187
  diff --git a/newempty b/newempty
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   188
  new file mode 100644
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   189
  
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   190
  % git=auto: git diff for rmempty
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   191
  diff --git a/rmempty b/rmempty
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   192
  deleted file mode 100644
10189
e451e599fbcf patch: support diff data loss detection and upgrade
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   193
12149
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   194
git=warn: regular diff with data loss warnings
10189
e451e599fbcf patch: support diff data loss detection and upgrade
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   195
12149
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   196
  $ hg autodiff --git=warn
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   197
  diff -r b3f053cd7c7f binary
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   198
  Binary file binary has changed
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   199
  diff -r b3f053cd7c7f exec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   200
  --- a/exec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   201
  +++ b/exec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   202
  @@ -1,1 +1,2 @@
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   203
   exec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   204
  +exec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   205
  diff -r b3f053cd7c7f newbinary
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   206
  Binary file newbinary has changed
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   207
  diff -r b3f053cd7c7f newexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   208
  --- /dev/null
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   209
  +++ b/newexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   210
  @@ -0,0 +1,1 @@
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   211
  +newexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   212
  diff -r b3f053cd7c7f newregular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   213
  --- /dev/null
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   214
  +++ b/newregular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   215
  @@ -0,0 +1,1 @@
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   216
  +newregular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   217
  diff -r b3f053cd7c7f regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   218
  --- a/regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   219
  +++ b/regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   220
  @@ -1,1 +1,2 @@
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   221
   regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   222
  +regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   223
  diff -r b3f053cd7c7f rmbinary
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   224
  Binary file rmbinary has changed
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   225
  diff -r b3f053cd7c7f rmexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   226
  --- a/rmexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   227
  +++ /dev/null
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   228
  @@ -1,1 +0,0 @@
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   229
  -rmexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   230
  diff -r b3f053cd7c7f rmregular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   231
  --- a/rmregular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   232
  +++ /dev/null
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   233
  @@ -1,1 +0,0 @@
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   234
  -rmregular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   235
  data lost for: binary
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   236
  data lost for: newbinary
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   237
  data lost for: newempty
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   238
  data lost for: newexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   239
  data lost for: rmempty
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   240
  data lost for: setexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   241
  data lost for: unsetexec
10189
e451e599fbcf patch: support diff data loss detection and upgrade
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   242
12149
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   243
git=abort: fail on execute bit change
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   244
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   245
  $ hg autodiff --git=abort regular setexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   246
  abort: losing data for setexec
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   247
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   248
git=abort: succeed on regular file
10189
e451e599fbcf patch: support diff data loss detection and upgrade
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   249
12149
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   250
  $ hg autodiff --git=abort regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   251
  diff -r b3f053cd7c7f regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   252
  --- a/regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   253
  +++ b/regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   254
  @@ -1,1 +1,2 @@
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   255
   regular
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   256
  +regular
10189
e451e599fbcf patch: support diff data loss detection and upgrade
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   257
12149
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   258
  $ cd ..
3213e56d63aa tests: unify test-diff-upgrade
Adrian Buehlmann <adrian@cadifra.com>
parents: 11551
diff changeset
   259