annotate tests/test-git-export.t @ 14927:2aa3e07b2f07

posix, windows: introduce cachestat This class contains a stat result, and possibly other file info to reliably determine between two points in time whether a file has changed. Uniquely identifying a file gives us that reliability because we either atomic rename or append. So one of two will happen: the file 'id' will change, or the size of the file will change. posix implements it simply by calling os.stat() and checking if the result has st_ino. For now on Windows we always assume the path is uncacheable. This can be improved on NTFS due to file IDs: http://msdn.microsoft.com/en-us/library/aa363788(v=vs.85).aspx So we need to find out if a file path is on an NTFS drive, for that we have: - GetVolumeInformation, which unfortunately only works with a root path (but is available on XP) - GetVolumeInformationByHandleW, works on a full file path but requires Vista or higher
author Idan Kamara <idankk86@gmail.com>
date Mon, 25 Jul 2011 15:03:02 +0300
parents 927e1a677267
children db0340f4b507
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
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
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
59 chmod 644:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
60
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
61 $ chmod +x src
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
62 $ hg ci -munexec
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
63 $ hg diff --git -r 5:tip
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
64 diff --git a/src b/src
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
65 old mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
66 new mode 100755
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
67
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
68 Rename+mod+chmod:
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
69
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
70 $ hg mv src dst
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
71 $ chmod -x dst
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
72 $ echo a >> dst
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
73 $ hg ci -mrenamemod
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
74 $ hg diff --git -r 6:tip
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
75 diff --git a/src b/dst
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
76 old mode 100755
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
77 new mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
78 rename from src
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
79 rename to dst
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
80 --- a/src
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
81 +++ b/dst
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
82 @@ -3,3 +3,4 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
83 3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
84 4
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
85 5
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
86 +a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
87
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
88 Nonexistent in tip+chmod:
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 $ hg diff --git -r 5:6
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
91 diff --git a/src b/src
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
92 old mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
93 new mode 100755
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
94
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
95 Binary diff:
3066
035fd2029575 git --diff: fix traceback when getting mode change
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2935
diff changeset
96
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
97 $ cp $TESTDIR/binfile.bin .
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
98 $ hg add binfile.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
99 $ hg diff --git > b.diff
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
100 $ cat b.diff
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
101 diff --git a/binfile.bin b/binfile.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
102 new file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
103 index 0000000000000000000000000000000000000000..37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
104 GIT binary patch
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
105 literal 593
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
106 zc$@)I0<QguP)<h;3K|Lk000e1NJLTq000mG000mO0ssI2kdbIM00009a7bBm000XU
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
107 z000XU0RWnu7ytkO2XskIMF-Uh9TW;VpMjwv0005-Nkl<ZD9@FWPs=e;7{<>W$NUkd
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
108 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
109 z*IoDB)sG^CfNuoBmqLTVU^<;@nwHP!1wrWd`{(mHo6VNXWtyh{alzqmsH*yYzpvLT
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
110 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
111 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
112 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
113 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
114 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
115 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
116 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
117 fQItJW-{SoTm)8|5##k|m00000NkvXXu0mjf{mKw4
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
118
3368
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
119
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
120 Import binary diff:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
121
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
122 $ hg revert binfile.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
123 $ rm binfile.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
124 $ hg import -mfoo b.diff
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
125 applying b.diff
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
126 $ cmp binfile.bin $TESTDIR/binfile.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
127
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
128 Rename binary file:
3368
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
129
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
130 $ hg mv binfile.bin renamed.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
131 $ hg diff --git
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
132 diff --git a/binfile.bin b/renamed.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
133 rename from binfile.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
134 rename to renamed.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
135
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
136 Diff across many revisions:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
137
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
138 $ hg mv dst dst2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
139 $ hg ci -m 'mv dst dst2'
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 $ echo >> start
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
142 $ hg ci -m 'change start'
3368
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
143
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
144 $ hg revert -r -2 start
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
145 $ hg mv dst2 dst3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
146 $ hg ci -m 'mv dst2 dst3; revert start'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
147
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
148 $ hg diff --git -r 9:11
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
149 diff --git a/dst2 b/dst3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
150 rename from dst2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
151 rename to dst3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
152
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
153 Reversed:
4092
4ced663bebf0 git patches: handle renames of binary files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3702
diff changeset
154
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
155 $ hg diff --git -r 11:9
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
156 diff --git a/dst3 b/dst2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
157 rename from dst3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
158 rename to dst2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
159
3693
454b3a8cdf28 diff: improve detection of renames when diffing across many revisions
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3368
diff changeset
160
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
161 $ echo a >> foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
162 $ hg add foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
163 $ hg ci -m 'add foo'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
164 $ echo b >> foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
165 $ hg ci -m 'change foo'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
166 $ hg mv foo bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
167 $ hg ci -m 'mv foo bar'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
168 $ echo c >> bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
169 $ 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
170
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
171 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
172
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
173 $ hg diff --git -r -3:-1
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
174 diff --git a/foo b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
175 rename from foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
176 rename to bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
177 --- a/foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
178 +++ b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
179 @@ -1,2 +1,3 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
180 a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
181 b
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
182 +c
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
183
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
184 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
185
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
186 $ hg diff --git -r -1:-3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
187 diff --git a/bar b/foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
188 rename from bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
189 rename to foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
190 --- a/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
191 +++ b/foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
192 @@ -1,3 +1,2 @@
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 File created in r1 and renamed before r2:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
198
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
199 $ hg diff --git -r -4:-1
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
200 diff --git a/foo b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
201 rename from foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
202 rename to bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
203 --- a/foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
204 +++ b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
205 @@ -1,1 +1,3 @@
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 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
211
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
212 $ hg diff --git -r -1:-4
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
213 diff --git a/bar b/foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
214 rename from bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
215 rename to foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
216 --- a/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
217 +++ b/foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
218 @@ -1,3 +1,1 @@
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 File created after r1 and renamed before r2:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
224
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
225 $ hg diff --git -r -5:-1
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
226 diff --git a/bar b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
227 new file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
228 --- /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
229 +++ b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
230 @@ -0,0 +1,3 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
231 +a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
232 +b
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
233 +c
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
234
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
235 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
236
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
237 $ hg diff --git -r -1:-5
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
238 diff --git a/bar b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
239 deleted file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
240 --- a/bar
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 @@ -1,3 +0,0 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
243 -a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
244 -b
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
245 -c
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
246
3695
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
247
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
248 Comparing with the working dir:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
249
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
250 $ echo >> start
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
251 $ hg ci -m 'change start again'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
252
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
253 $ echo > created
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
254 $ hg add created
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
255 $ hg ci -m 'add created'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
256
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
257 $ hg mv created created2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
258 $ hg ci -m 'mv created created2'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
259
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
260 $ hg mv created2 created3
3695
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
261
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
262 There's a copy in the working dir:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
263
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
264 $ hg diff --git
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
265 diff --git a/created2 b/created3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
266 rename from created2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
267 rename to created3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
268
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
269 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
270
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
271 $ hg diff --git -r -2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
272 diff --git a/created b/created3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
273 rename from created
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
274 rename to created3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
275
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
276 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
277
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
278 $ hg diff --git -r -3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
279 diff --git a/created3 b/created3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
280 new file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
281 --- /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
282 +++ b/created3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
283 @@ -0,0 +1,1 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
284 +
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
285 $ hg ci -m 'mv created2 created3'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
286
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
287
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
288 $ echo > brand-new
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
289 $ hg add brand-new
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
290 $ hg ci -m 'add brand-new'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
291 $ hg mv brand-new brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
292
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
293 Created in parent of wd; renamed in the wd:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
294
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
295 $ hg diff --git
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
296 diff --git a/brand-new b/brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
297 rename from brand-new
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
298 rename to brand-new2
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 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
301
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
302 $ hg diff --git -r -2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
303 diff --git a/brand-new2 b/brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
304 new file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
305 --- /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
306 +++ b/brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
307 @@ -0,0 +1,1 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
308 +
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
309 $ hg ci -m 'mv brand-new brand-new2'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
310
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
311 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
312
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
313 $ hg cp brand-new2 brand-new3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
314 $ hg mv brand-new2 brand-new3-2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
315 $ hg ci -m 'multiple renames/copies'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
316 $ hg diff --git -r -2 -r -1
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
317 diff --git a/brand-new2 b/brand-new3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
318 rename from brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
319 rename to brand-new3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
320 diff --git a/brand-new2 b/brand-new3-2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
321 copy from brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
322 copy to brand-new3-2
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 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
325
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
326 $ hg diff --git -r -1 -r -2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
327 diff --git a/brand-new3 b/brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
328 rename from brand-new3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
329 rename to brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
330 diff --git a/brand-new3-2 b/brand-new3-2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
331 deleted file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
332 --- a/brand-new3-2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
333 +++ /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
334 @@ -1,1 +0,0 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
335 -
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
336
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
337 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
338
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
339 $ echo foo > 'with spaces'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
340 $ hg add 'with spaces'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
341 $ hg diff --git
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
342 diff --git a/with spaces b/with spaces
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
343 new file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
344 --- /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
345 +++ b/with spaces
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
346 @@ -0,0 +1,1 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
347 +foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
348 $ hg ci -m 'add filename with spaces'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
349