tests/test-git-export.t
author Matt Mackall <mpm@selenic.com>
Sat, 18 Oct 2014 18:14:48 -0500
branchstable
changeset 23052 c1ae0b2c1719
parent 19973 1184edaead7a
child 24432 e22248f6d257
permissions -rw-r--r--
Added signature for changeset 7f8d16af8cae
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
     1
  $ hg init
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
     2
  $ echo start > start
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
     3
  $ hg ci -Amstart
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
     4
  adding start
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     5
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
     6
New file:
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     7
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
     8
  $ echo new > new
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
     9
  $ hg ci -Amnew
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    10
  adding new
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    11
  $ hg diff --git -r 0
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    12
  diff --git a/new b/new
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    13
  new file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    14
  --- /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    15
  +++ b/new
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    16
  @@ -0,0 +1,1 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    17
  +new
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    18
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    19
Copy:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    20
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    21
  $ hg cp new copy
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    22
  $ hg ci -mcopy
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    23
  $ hg diff --git -r 1:tip
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    24
  diff --git a/new b/copy
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    25
  copy from new
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    26
  copy to copy
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    27
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    28
Rename:
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    29
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    30
  $ hg mv copy rename
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    31
  $ hg ci -mrename
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    32
  $ hg diff --git -r 2:tip
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    33
  diff --git a/copy b/rename
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    34
  rename from copy
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    35
  rename to rename
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    36
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    37
Delete:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    38
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    39
  $ hg rm rename
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    40
  $ hg ci -mdelete
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    41
  $ hg diff --git -r 3:tip
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    42
  diff --git a/rename b/rename
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    43
  deleted file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    44
  --- a/rename
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    45
  +++ /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    46
  @@ -1,1 +0,0 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    47
  -new
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    48
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    49
  $ cat > src <<EOF
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    50
  > 1
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    51
  > 2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    52
  > 3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    53
  > 4
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    54
  > 5
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    55
  > EOF
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    56
  $ hg ci -Amsrc
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    57
  adding src
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    58
16899
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
    59
#if execbit
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
    60
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    61
chmod 644:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    62
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    63
  $ chmod +x src
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    64
  $ hg ci -munexec
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    65
  $ hg diff --git -r 5:tip
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    66
  diff --git a/src b/src
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    67
  old mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    68
  new mode 100755
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    69
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    70
Rename+mod+chmod:
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    71
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    72
  $ hg mv src dst
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    73
  $ chmod -x dst
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    74
  $ echo a >> dst
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    75
  $ hg ci -mrenamemod
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    76
  $ hg diff --git -r 6:tip
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    77
  diff --git a/src b/dst
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    78
  old mode 100755
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    79
  new mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    80
  rename from src
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    81
  rename to dst
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    82
  --- a/src
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    83
  +++ b/dst
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    84
  @@ -3,3 +3,4 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    85
   3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    86
   4
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    87
   5
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    88
  +a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    89
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    90
Nonexistent in tip+chmod:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    91
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    92
  $ hg diff --git -r 5:6
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    93
  diff --git a/src b/src
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    94
  old mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
    95
  new mode 100755
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    96
16899
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
    97
#else
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
    98
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
    99
Dummy changes when no exec bit, mocking the execbit commit structure
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
   100
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
   101
  $ echo change >> src
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
   102
  $ hg ci -munexec
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
   103
  $ hg mv src dst
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
   104
  $ hg ci -mrenamemod
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
   105
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
   106
#endif
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
   107
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   108
Binary diff:
3066
035fd2029575 git --diff: fix traceback when getting mode change
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2935
diff changeset
   109
16350
4f795f5fbb0b tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents: 15442
diff changeset
   110
  $ cp "$TESTDIR/binfile.bin" .
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   111
  $ hg add binfile.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   112
  $ hg diff --git > b.diff
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   113
  $ cat b.diff
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   114
  diff --git a/binfile.bin b/binfile.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   115
  new file mode 100644
19875
c172660eee01 patch: Fix nullid for binary git diffs (issue4054)
Johan Bjork <jbjoerk@gmail.com>
parents: 18355
diff changeset
   116
  index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   117
  GIT binary patch
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   118
  literal 593
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   119
  zc$@)I0<QguP)<h;3K|Lk000e1NJLTq000mG000mO0ssI2kdbIM00009a7bBm000XU
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   120
  z000XU0RWnu7ytkO2XskIMF-Uh9TW;VpMjwv0005-Nkl<ZD9@FWPs=e;7{<>W$NUkd
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   121
  zX$nnYLt$-$V!?uy+1V%`z&Eh=ah|duER<4|QWhju3gb^nF*8iYobxWG-qqXl=2~5M
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   122
  z*IoDB)sG^CfNuoBmqLTVU^<;@nwHP!1wrWd`{(mHo6VNXWtyh{alzqmsH*yYzpvLT
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   123
  zLdY<T=ks|woh-`&01!ej#(xbV1f|pI*=%;d-%F*E*X#ZH`4I%6SS+$EJDE&ct=8po
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   124
  ziN#{?_j|kD%Cd|oiqds`xm@;oJ-^?NG3Gdqrs?5u*zI;{nogxsx~^|Fn^Y?Gdc6<;
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   125
  zfMJ+iF1J`LMx&A2?dEwNW8ClebzPTbIh{@$hS6*`kH@1d%Lo7fA#}N1)oN7`gm$~V
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   126
  z+wDx#)OFqMcE{s!JN0-xhG8ItAjVkJwEcb`3WWlJfU2r?;Pd%dmR+q@mSri5q9_W-
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   127
  zaR2~ECX?B2w+zELozC0s*6Z~|QG^f{3I#<`?)Q7U-JZ|q5W;9Q8i_=pBuSzunx=U;
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   128
  z9C)5jBoYw9^?EHyQl(M}1OlQcCX>lXB*ODN003Z&P17_@)3Pi=i0wb04<W?v-u}7K
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   129
  zXmmQA+wDgE!qR9o8jr`%=ab_&uh(l?R=r;Tjiqon91I2-hIu?57~@*4h7h9uORK#=
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   130
  fQItJW-{SoTm)8|5##k|m00000NkvXXu0mjf{mKw4
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   131
  
3368
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
   132
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   133
Import binary diff:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   134
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   135
  $ hg revert binfile.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   136
  $ rm binfile.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   137
  $ hg import -mfoo b.diff
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   138
  applying b.diff
16350
4f795f5fbb0b tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents: 15442
diff changeset
   139
  $ cmp binfile.bin "$TESTDIR/binfile.bin"
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   140
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   141
Rename binary file:
3368
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
   142
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   143
  $ hg mv binfile.bin renamed.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   144
  $ hg diff --git
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   145
  diff --git a/binfile.bin b/renamed.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   146
  rename from binfile.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   147
  rename to renamed.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   148
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   149
Diff across many revisions:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   150
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   151
  $ hg mv dst dst2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   152
  $ hg ci -m 'mv dst dst2'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   153
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   154
  $ echo >> start
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   155
  $ hg ci -m 'change start'
3368
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
   156
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   157
  $ hg revert -r -2 start
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   158
  $ hg mv dst2 dst3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   159
  $ hg ci -m 'mv dst2 dst3; revert start'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   160
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   161
  $ hg diff --git -r 9:11
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   162
  diff --git a/dst2 b/dst3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   163
  rename from dst2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   164
  rename to dst3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   165
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   166
Reversed:
4092
4ced663bebf0 git patches: handle renames of binary files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3702
diff changeset
   167
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   168
  $ hg diff --git -r 11:9
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   169
  diff --git a/dst3 b/dst2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   170
  rename from dst3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   171
  rename to dst2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   172
3693
454b3a8cdf28 diff: improve detection of renames when diffing across many revisions
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3368
diff changeset
   173
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   174
  $ echo a >> foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   175
  $ hg add foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   176
  $ hg ci -m 'add foo'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   177
  $ echo b >> foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   178
  $ hg ci -m 'change foo'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   179
  $ hg mv foo bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   180
  $ hg ci -m 'mv foo bar'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   181
  $ echo c >> bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   182
  $ hg ci -m 'change bar'
3693
454b3a8cdf28 diff: improve detection of renames when diffing across many revisions
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3368
diff changeset
   183
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   184
File created before r1 and renamed before r2:
3693
454b3a8cdf28 diff: improve detection of renames when diffing across many revisions
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3368
diff changeset
   185
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   186
  $ hg diff --git -r -3:-1
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   187
  diff --git a/foo b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   188
  rename from foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   189
  rename to bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   190
  --- a/foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   191
  +++ b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   192
  @@ -1,2 +1,3 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   193
   a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   194
   b
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   195
  +c
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   196
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   197
Reversed:
3694
c0b1a0c72c7d renamedbetween: only return (file, node) pairs that exist in the original rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3693
diff changeset
   198
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   199
  $ hg diff --git -r -1:-3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   200
  diff --git a/bar b/foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   201
  rename from bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   202
  rename to foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   203
  --- a/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   204
  +++ b/foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   205
  @@ -1,3 +1,2 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   206
   a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   207
   b
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   208
  -c
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   209
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   210
File created in r1 and renamed before r2:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   211
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   212
  $ hg diff --git -r -4:-1
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   213
  diff --git a/foo b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   214
  rename from foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   215
  rename to bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   216
  --- a/foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   217
  +++ b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   218
  @@ -1,1 +1,3 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   219
   a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   220
  +b
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   221
  +c
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   222
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   223
Reversed:
3694
c0b1a0c72c7d renamedbetween: only return (file, node) pairs that exist in the original rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3693
diff changeset
   224
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   225
  $ hg diff --git -r -1:-4
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   226
  diff --git a/bar b/foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   227
  rename from bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   228
  rename to foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   229
  --- a/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   230
  +++ b/foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   231
  @@ -1,3 +1,1 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   232
   a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   233
  -b
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   234
  -c
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   235
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   236
File created after r1 and renamed before r2:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   237
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   238
  $ hg diff --git -r -5:-1
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   239
  diff --git a/bar b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   240
  new file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   241
  --- /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   242
  +++ b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   243
  @@ -0,0 +1,3 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   244
  +a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   245
  +b
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   246
  +c
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   247
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   248
Reversed:
3694
c0b1a0c72c7d renamedbetween: only return (file, node) pairs that exist in the original rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3693
diff changeset
   249
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   250
  $ hg diff --git -r -1:-5
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   251
  diff --git a/bar b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   252
  deleted file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   253
  --- a/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   254
  +++ /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   255
  @@ -1,3 +0,0 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   256
  -a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   257
  -b
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   258
  -c
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   259
3695
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
   260
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   261
Comparing with the working dir:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   262
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   263
  $ echo >> start
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   264
  $ hg ci -m 'change start again'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   265
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   266
  $ echo > created
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   267
  $ hg add created
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   268
  $ hg ci -m 'add created'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   269
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   270
  $ hg mv created created2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   271
  $ hg ci -m 'mv created created2'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   272
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   273
  $ hg mv created2 created3
3695
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
   274
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   275
There's a copy in the working dir:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   276
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   277
  $ hg diff --git
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   278
  diff --git a/created2 b/created3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   279
  rename from created2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   280
  rename to created3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   281
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   282
There's another copy between the original rev and the wd:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   283
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   284
  $ hg diff --git -r -2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   285
  diff --git a/created b/created3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   286
  rename from created
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   287
  rename to created3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   288
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   289
The source of the copy was created after the original rev:
3695
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
   290
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   291
  $ hg diff --git -r -3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   292
  diff --git a/created3 b/created3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   293
  new file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   294
  --- /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   295
  +++ b/created3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   296
  @@ -0,0 +1,1 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   297
  +
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   298
  $ hg ci -m 'mv created2 created3'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   299
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   300
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   301
  $ echo > brand-new
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   302
  $ hg add brand-new
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   303
  $ hg ci -m 'add brand-new'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   304
  $ hg mv brand-new brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   305
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   306
Created in parent of wd; renamed in the wd:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   307
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   308
  $ hg diff --git
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   309
  diff --git a/brand-new b/brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   310
  rename from brand-new
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   311
  rename to brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   312
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   313
Created between r1 and parent of wd; renamed in the wd:
3696
562a65635bcb diff: better detection of renames when comparing with the working dir.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3695
diff changeset
   314
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   315
  $ hg diff --git -r -2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   316
  diff --git a/brand-new2 b/brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   317
  new file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   318
  --- /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   319
  +++ b/brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   320
  @@ -0,0 +1,1 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   321
  +
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   322
  $ hg ci -m 'mv brand-new brand-new2'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   323
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   324
One file is copied to many destinations and removed:
3696
562a65635bcb diff: better detection of renames when comparing with the working dir.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3695
diff changeset
   325
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   326
  $ hg cp brand-new2 brand-new3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   327
  $ hg mv brand-new2 brand-new3-2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   328
  $ hg ci -m 'multiple renames/copies'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   329
  $ hg diff --git -r -2 -r -1
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   330
  diff --git a/brand-new2 b/brand-new3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   331
  rename from brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   332
  rename to brand-new3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   333
  diff --git a/brand-new2 b/brand-new3-2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   334
  copy from brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   335
  copy to brand-new3-2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   336
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   337
Reversed:
3702
70c3ee224c08 Don't generate git patches that rename a file to multiple destinations
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3696
diff changeset
   338
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   339
  $ hg diff --git -r -1 -r -2
18355
2330d97e7707 copies: make the loss in _backwardcopies more stable
Mads Kiilerich <mads@kiilerich.com>
parents: 16899
diff changeset
   340
  diff --git a/brand-new3-2 b/brand-new2
2330d97e7707 copies: make the loss in _backwardcopies more stable
Mads Kiilerich <mads@kiilerich.com>
parents: 16899
diff changeset
   341
  rename from brand-new3-2
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   342
  rename to brand-new2
18355
2330d97e7707 copies: make the loss in _backwardcopies more stable
Mads Kiilerich <mads@kiilerich.com>
parents: 16899
diff changeset
   343
  diff --git a/brand-new3 b/brand-new3
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   344
  deleted file mode 100644
18355
2330d97e7707 copies: make the loss in _backwardcopies more stable
Mads Kiilerich <mads@kiilerich.com>
parents: 16899
diff changeset
   345
  --- a/brand-new3
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   346
  +++ /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   347
  @@ -1,1 +0,0 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   348
  -
3702
70c3ee224c08 Don't generate git patches that rename a file to multiple destinations
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3696
diff changeset
   349
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   350
There should be a trailing TAB if there are spaces in the file name:
4679
826659bd8053 git patches: correct handling of filenames with spaces
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4096
diff changeset
   351
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   352
  $ echo foo > 'with spaces'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   353
  $ hg add 'with spaces'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   354
  $ hg diff --git
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   355
  diff --git a/with spaces b/with spaces
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   356
  new file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   357
  --- /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   358
  +++ b/with spaces	
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   359
  @@ -0,0 +1,1 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   360
  +foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   361
  $ hg ci -m 'add filename with spaces'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
   362
19973
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
   363
Additions should be properly marked even in the middle of a merge
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
   364
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
   365
  $ hg up -r -2
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
   366
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
   367
  $ echo "New File" >> inmerge
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
   368
  $ hg add inmerge
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
   369
  $ hg ci -m "file in merge"
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
   370
  created new head
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
   371
  $ hg up 23
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
   372
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
   373
  $ hg merge
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
   374
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
   375
  (branch merge, don't forget to commit)
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
   376
  $ hg diff -g
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
   377
  diff --git a/inmerge b/inmerge
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
   378
  new file mode 100644
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
   379
  --- /dev/null
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
   380
  +++ b/inmerge
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
   381
  @@ -0,0 +1,1 @@
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
   382
  +New File