tests/test-git-export
author Gilles Moris <gilles.moris@free.fr>
Mon, 30 Nov 2009 23:51:06 +0100
changeset 10014 54cd28258ea7
parent 8167 6c82beaaa11a
permissions -rwxr-xr-x
status: add the --change option to display files changed in a revision This option is similar to the one already used for the diff command. Unfortunately, the c and C short option are already used for status, so there is no corresponding short option. However, there is no short option for --rev either, so that's consistent.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     1
#!/bin/sh
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     2
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     3
hg init a
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     4
cd a
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     5
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     6
echo start > start
8167
6c82beaaa11a tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents: 5264
diff changeset
     7
hg ci -Amstart
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     8
echo new > new
8167
6c82beaaa11a tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents: 5264
diff changeset
     9
hg ci -Amnew
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    10
echo '% new file'
3199
096f1c73cdc3 Add -D/--nodates options to hg diff/export that removes dates from diff headers
Stephen Darnell <stephen@darnell.plus.com>
parents: 3066
diff changeset
    11
hg diff --git -r 0
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    12
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    13
hg cp new copy
8167
6c82beaaa11a tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents: 5264
diff changeset
    14
hg ci -mcopy
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    15
echo '% copy'
3199
096f1c73cdc3 Add -D/--nodates options to hg diff/export that removes dates from diff headers
Stephen Darnell <stephen@darnell.plus.com>
parents: 3066
diff changeset
    16
hg diff --git -r 1:tip
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    17
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    18
hg mv copy rename
8167
6c82beaaa11a tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents: 5264
diff changeset
    19
hg ci -mrename
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    20
echo '% rename'
3199
096f1c73cdc3 Add -D/--nodates options to hg diff/export that removes dates from diff headers
Stephen Darnell <stephen@darnell.plus.com>
parents: 3066
diff changeset
    21
hg diff --git -r 2:tip
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    22
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    23
hg rm rename
8167
6c82beaaa11a tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents: 5264
diff changeset
    24
hg ci -mdelete
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    25
echo '% delete'
3199
096f1c73cdc3 Add -D/--nodates options to hg diff/export that removes dates from diff headers
Stephen Darnell <stephen@darnell.plus.com>
parents: 3066
diff changeset
    26
hg diff --git -r 3:tip
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    27
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    28
cat > src <<EOF
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    29
1
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    30
2
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    31
3
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    32
4
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    33
5
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    34
EOF
8167
6c82beaaa11a tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents: 5264
diff changeset
    35
hg ci -Amsrc
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    36
chmod +x src
8167
6c82beaaa11a tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents: 5264
diff changeset
    37
hg ci -munexec
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    38
echo '% chmod 644'
3199
096f1c73cdc3 Add -D/--nodates options to hg diff/export that removes dates from diff headers
Stephen Darnell <stephen@darnell.plus.com>
parents: 3066
diff changeset
    39
hg diff --git -r 5:tip
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    40
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    41
hg mv src dst
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    42
chmod -x dst
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    43
echo a >> dst
8167
6c82beaaa11a tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents: 5264
diff changeset
    44
hg ci -mrenamemod
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    45
echo '% rename+mod+chmod'
3199
096f1c73cdc3 Add -D/--nodates options to hg diff/export that removes dates from diff headers
Stephen Darnell <stephen@darnell.plus.com>
parents: 3066
diff changeset
    46
hg diff --git -r 6:tip
3066
035fd2029575 git --diff: fix traceback when getting mode change
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2935
diff changeset
    47
035fd2029575 git --diff: fix traceback when getting mode change
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2935
diff changeset
    48
echo '% nonexistent in tip+chmod'
3199
096f1c73cdc3 Add -D/--nodates options to hg diff/export that removes dates from diff headers
Stephen Darnell <stephen@darnell.plus.com>
parents: 3066
diff changeset
    49
hg diff --git -r 5:6
3368
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
    50
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
    51
echo '% binary diff'
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
    52
cp $TESTDIR/binfile.bin .
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
    53
hg add binfile.bin
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
    54
hg diff --git > b.diff
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
    55
cat b.diff
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
    56
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
    57
echo '% import binary diff'
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
    58
hg revert binfile.bin
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
    59
rm binfile.bin
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
    60
hg import -mfoo b.diff
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
    61
cmp binfile.bin $TESTDIR/binfile.bin
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
    62
3693
454b3a8cdf28 diff: improve detection of renames when diffing across many revisions
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3368
diff changeset
    63
echo
4092
4ced663bebf0 git patches: handle renames of binary files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3702
diff changeset
    64
echo '% rename binary file'
4ced663bebf0 git patches: handle renames of binary files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3702
diff changeset
    65
hg mv binfile.bin renamed.bin
4ced663bebf0 git patches: handle renames of binary files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3702
diff changeset
    66
hg diff --git
4ced663bebf0 git patches: handle renames of binary files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3702
diff changeset
    67
4ced663bebf0 git patches: handle renames of binary files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3702
diff changeset
    68
echo
3693
454b3a8cdf28 diff: improve detection of renames when diffing across many revisions
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3368
diff changeset
    69
echo '% diff across many revisions'
454b3a8cdf28 diff: improve detection of renames when diffing across many revisions
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3368
diff changeset
    70
hg mv dst dst2
8167
6c82beaaa11a tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents: 5264
diff changeset
    71
hg ci -m 'mv dst dst2'
3693
454b3a8cdf28 diff: improve detection of renames when diffing across many revisions
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3368
diff changeset
    72
454b3a8cdf28 diff: improve detection of renames when diffing across many revisions
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3368
diff changeset
    73
echo >> start
8167
6c82beaaa11a tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents: 5264
diff changeset
    74
hg ci -m 'change start'
3693
454b3a8cdf28 diff: improve detection of renames when diffing across many revisions
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3368
diff changeset
    75
454b3a8cdf28 diff: improve detection of renames when diffing across many revisions
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3368
diff changeset
    76
hg revert -r -2 start
454b3a8cdf28 diff: improve detection of renames when diffing across many revisions
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3368
diff changeset
    77
hg mv dst2 dst3
8167
6c82beaaa11a tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents: 5264
diff changeset
    78
hg ci -m 'mv dst2 dst3; revert start'
3693
454b3a8cdf28 diff: improve detection of renames when diffing across many revisions
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3368
diff changeset
    79
454b3a8cdf28 diff: improve detection of renames when diffing across many revisions
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3368
diff changeset
    80
hg diff --git -r 9:11
5264
0fc16031bb45 Make hg diff --git -r revA:revB detect (inverted) copies if revA > revB
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4679
diff changeset
    81
echo '%  reversed'
0fc16031bb45 Make hg diff --git -r revA:revB detect (inverted) copies if revA > revB
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4679
diff changeset
    82
hg diff --git -r 11:9
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
    83
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
    84
echo a >> foo
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
    85
hg add foo
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
    86
hg ci -m 'add foo'
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
    87
echo b >> foo
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
    88
hg ci -m 'change foo'
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
    89
hg mv foo bar
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
    90
hg ci -m 'mv foo bar'
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
    91
echo c >> bar
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
    92
hg ci -m 'change bar'
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
    93
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
    94
echo
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
    95
echo '% file created before r1 and renamed before r2'
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
    96
hg diff --git -r -3:-1
5264
0fc16031bb45 Make hg diff --git -r revA:revB detect (inverted) copies if revA > revB
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4679
diff changeset
    97
echo '%  reversed'
0fc16031bb45 Make hg diff --git -r revA:revB detect (inverted) copies if revA > revB
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4679
diff changeset
    98
hg diff --git -r -1:-3
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
    99
echo
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
   100
echo '% file created in r1 and renamed before r2'
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
   101
hg diff --git -r -4:-1
5264
0fc16031bb45 Make hg diff --git -r revA:revB detect (inverted) copies if revA > revB
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4679
diff changeset
   102
echo '%  reversed'
0fc16031bb45 Make hg diff --git -r revA:revB detect (inverted) copies if revA > revB
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4679
diff changeset
   103
hg diff --git -r -1:-4
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
   104
echo
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
   105
echo '% file created after r1 and renamed before r2'
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
   106
hg diff --git -r -5:-1
5264
0fc16031bb45 Make hg diff --git -r revA:revB detect (inverted) copies if revA > revB
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4679
diff changeset
   107
echo '%  reversed'
0fc16031bb45 Make hg diff --git -r revA:revB detect (inverted) copies if revA > revB
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4679
diff changeset
   108
hg diff --git -r -1:-5
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
   109
3695
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
   110
echo
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
   111
echo '% comparing with the working dir'
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
   112
echo >> start
8167
6c82beaaa11a tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents: 5264
diff changeset
   113
hg ci -m 'change start again'
3695
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
   114
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
   115
echo > created
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
   116
hg add created
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
   117
hg ci -m 'add created'
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
   118
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
   119
hg mv created created2
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
   120
hg ci -m 'mv created created2'
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
   121
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
   122
hg mv created2 created3
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
   123
echo "% there's a copy in the working dir..."
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
   124
hg diff --git
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
   125
echo
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
   126
echo "% ...but there's another copy between the original rev and the wd"
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
   127
hg diff --git -r -2
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
   128
echo
562a65635bcb diff: better detection of renames when comparing with the working dir.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3695
diff changeset
   129
echo "% ...but the source of the copy was created after the original rev"
562a65635bcb diff: better detection of renames when comparing with the working dir.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3695
diff changeset
   130
hg diff --git -r -3
562a65635bcb diff: better detection of renames when comparing with the working dir.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3695
diff changeset
   131
hg ci -m 'mv created2 created3'
562a65635bcb diff: better detection of renames when comparing with the working dir.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3695
diff changeset
   132
562a65635bcb diff: better detection of renames when comparing with the working dir.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3695
diff changeset
   133
echo > brand-new
562a65635bcb diff: better detection of renames when comparing with the working dir.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3695
diff changeset
   134
hg add brand-new
562a65635bcb diff: better detection of renames when comparing with the working dir.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3695
diff changeset
   135
hg ci -m 'add brand-new'
562a65635bcb diff: better detection of renames when comparing with the working dir.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3695
diff changeset
   136
hg mv brand-new brand-new2
562a65635bcb diff: better detection of renames when comparing with the working dir.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3695
diff changeset
   137
echo '% created in parent of wd; renamed in the wd'
562a65635bcb diff: better detection of renames when comparing with the working dir.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3695
diff changeset
   138
hg diff --git
562a65635bcb diff: better detection of renames when comparing with the working dir.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3695
diff changeset
   139
562a65635bcb diff: better detection of renames when comparing with the working dir.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3695
diff changeset
   140
echo
562a65635bcb diff: better detection of renames when comparing with the working dir.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3695
diff changeset
   141
echo '% created between r1 and parent of wd; renamed in the wd'
562a65635bcb diff: better detection of renames when comparing with the working dir.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3695
diff changeset
   142
hg diff --git -r -2
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
   143
hg ci -m 'mv brand-new brand-new2'
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
   144
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
   145
echo '% one file is copied to many destinations and removed'
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
   146
hg cp brand-new2 brand-new3
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
   147
hg mv brand-new2 brand-new3-2
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
   148
hg ci -m 'multiple renames/copies'
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
   149
hg diff --git -r -2 -r -1
5264
0fc16031bb45 Make hg diff --git -r revA:revB detect (inverted) copies if revA > revB
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4679
diff changeset
   150
echo '%  reversed'
0fc16031bb45 Make hg diff --git -r revA:revB detect (inverted) copies if revA > revB
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4679
diff changeset
   151
hg diff --git -r -1 -r -2
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
   152
4679
826659bd8053 git patches: correct handling of filenames with spaces
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4096
diff changeset
   153
echo '% there should be a trailing TAB if there are spaces in the file name'
826659bd8053 git patches: correct handling of filenames with spaces
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4096
diff changeset
   154
echo foo > 'with spaces'
826659bd8053 git patches: correct handling of filenames with spaces
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4096
diff changeset
   155
hg add 'with spaces'
826659bd8053 git patches: correct handling of filenames with spaces
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4096
diff changeset
   156
hg diff --git
826659bd8053 git patches: correct handling of filenames with spaces
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4096
diff changeset
   157
hg ci -m 'add filename with spaces'
826659bd8053 git patches: correct handling of filenames with spaces
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4096
diff changeset
   158