Mercurial > hg
annotate tests/test-git-import @ 12574:77600d697d0e stable
patch: fix rename text to binary file (issue2400)
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Mon, 27 Sep 2010 22:47:10 +0200 |
parents | 377d879e9d1b |
children |
rev | line source |
---|---|
2864 | 1 #!/bin/sh |
2 | |
12574
77600d697d0e
patch: fix rename text to binary file (issue2400)
Patrick Mezard <pmezard@gmail.com>
parents:
10928
diff
changeset
|
3 . $TESTDIR/helpers.sh |
77600d697d0e
patch: fix rename text to binary file (issue2400)
Patrick Mezard <pmezard@gmail.com>
parents:
10928
diff
changeset
|
4 |
2864 | 5 hg init a |
6 cd a | |
7 | |
8 echo % new file | |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
9 hg import -d "1000000 0" -mnew - <<EOF |
2864 | 10 diff --git a/new b/new |
11 new file mode 100644 | |
12 index 0000000..7898192 | |
13 --- /dev/null | |
14 +++ b/new | |
15 @@ -0,0 +1 @@ | |
16 +a | |
17 EOF | |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
18 hg tip -q |
2864 | 19 |
3589
1c9b6f1237e0
test for git empty new files
Brendan Cully <brendan@kublai.com>
parents:
2864
diff
changeset
|
20 echo % new empty file |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
21 hg import -d "1000000 0" -mempty - <<EOF |
3589
1c9b6f1237e0
test for git empty new files
Brendan Cully <brendan@kublai.com>
parents:
2864
diff
changeset
|
22 diff --git a/empty b/empty |
1c9b6f1237e0
test for git empty new files
Brendan Cully <brendan@kublai.com>
parents:
2864
diff
changeset
|
23 new file mode 100644 |
1c9b6f1237e0
test for git empty new files
Brendan Cully <brendan@kublai.com>
parents:
2864
diff
changeset
|
24 EOF |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
25 hg tip -q |
3589
1c9b6f1237e0
test for git empty new files
Brendan Cully <brendan@kublai.com>
parents:
2864
diff
changeset
|
26 hg locate empty |
1c9b6f1237e0
test for git empty new files
Brendan Cully <brendan@kublai.com>
parents:
2864
diff
changeset
|
27 |
2864 | 28 echo % chmod +x |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
29 hg import -d "1000000 0" -msetx - <<EOF |
2864 | 30 diff --git a/new b/new |
31 old mode 100644 | |
32 new mode 100755 | |
33 EOF | |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
34 hg tip -q |
2864 | 35 |
36 test -x new || echo failed | |
37 | |
38 echo % copy | |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
39 hg import -d "1000000 0" -mcopy - <<EOF |
2864 | 40 diff --git a/new b/copy |
41 old mode 100755 | |
42 new mode 100644 | |
43 similarity index 100% | |
44 copy from new | |
45 copy to copy | |
46 diff --git a/new b/copyx | |
47 similarity index 100% | |
48 copy from new | |
49 copy to copyx | |
50 EOF | |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
51 hg tip -q |
2864 | 52 |
5073
4cd52978e188
test-git-import: fake executable permissions.
Patrick Mezard <pmezard@gmail.com>
parents:
4679
diff
changeset
|
53 if "$TESTDIR/hghave" -q execbit; then |
4cd52978e188
test-git-import: fake executable permissions.
Patrick Mezard <pmezard@gmail.com>
parents:
4679
diff
changeset
|
54 test -f copy -a ! -x copy || echo failed |
4cd52978e188
test-git-import: fake executable permissions.
Patrick Mezard <pmezard@gmail.com>
parents:
4679
diff
changeset
|
55 test -x copyx || echo failed |
4cd52978e188
test-git-import: fake executable permissions.
Patrick Mezard <pmezard@gmail.com>
parents:
4679
diff
changeset
|
56 else |
4cd52978e188
test-git-import: fake executable permissions.
Patrick Mezard <pmezard@gmail.com>
parents:
4679
diff
changeset
|
57 test -f copy || echo failed |
4cd52978e188
test-git-import: fake executable permissions.
Patrick Mezard <pmezard@gmail.com>
parents:
4679
diff
changeset
|
58 fi |
2864 | 59 cat copy |
60 hg cat copy | |
61 | |
62 echo % rename | |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
63 hg import -d "1000000 0" -mrename - <<EOF |
2864 | 64 diff --git a/copy b/rename |
65 similarity index 100% | |
66 rename from copy | |
67 rename to rename | |
68 EOF | |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
69 hg tip -q |
2864 | 70 |
71 hg locate | |
72 | |
73 echo % delete | |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
74 hg import -d "1000000 0" -mdelete - <<EOF |
2864 | 75 diff --git a/copyx b/copyx |
76 deleted file mode 100755 | |
77 index 7898192..0000000 | |
78 --- a/copyx | |
79 +++ /dev/null | |
80 @@ -1 +0,0 @@ | |
81 -a | |
82 EOF | |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
83 hg tip -q |
2864 | 84 |
85 hg locate | |
86 test -f copyx && echo failed || true | |
87 | |
88 echo % regular diff | |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
89 hg import -d "1000000 0" -mregular - <<EOF |
2864 | 90 diff --git a/rename b/rename |
91 index 7898192..72e1fe3 100644 | |
92 --- a/rename | |
93 +++ b/rename | |
94 @@ -1 +1,5 @@ | |
95 a | |
96 +a | |
97 +a | |
98 +a | |
99 +a | |
100 EOF | |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
101 hg tip -q |
2864 | 102 |
103 echo % copy and modify | |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
104 hg import -d "1000000 0" -mcopymod - <<EOF |
2864 | 105 diff --git a/rename b/copy2 |
106 similarity index 80% | |
107 copy from rename | |
108 copy to copy2 | |
109 index 72e1fe3..b53c148 100644 | |
110 --- a/rename | |
111 +++ b/copy2 | |
112 @@ -1,5 +1,5 @@ | |
113 a | |
114 a | |
115 -a | |
116 +b | |
117 a | |
118 a | |
119 EOF | |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
120 hg tip -q |
2864 | 121 |
122 hg cat copy2 | |
123 | |
124 echo % rename and modify | |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
125 hg import -d "1000000 0" -mrenamemod - <<EOF |
2864 | 126 diff --git a/copy2 b/rename2 |
127 similarity index 80% | |
128 rename from copy2 | |
129 rename to rename2 | |
130 index b53c148..8f81e29 100644 | |
131 --- a/copy2 | |
132 +++ b/rename2 | |
133 @@ -1,5 +1,5 @@ | |
134 a | |
135 a | |
136 b | |
137 -a | |
138 +c | |
139 a | |
140 EOF | |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
141 hg tip -q |
2864 | 142 |
143 hg locate copy2 | |
144 hg cat rename2 | |
3701
05c8704a3743
handle git patches that rename a file to more than one destination
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3589
diff
changeset
|
145 |
05c8704a3743
handle git patches that rename a file to more than one destination
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3589
diff
changeset
|
146 echo % one file renamed multiple times |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
147 hg import -d "1000000 0" -mmultirenames - <<EOF |
3701
05c8704a3743
handle git patches that rename a file to more than one destination
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3589
diff
changeset
|
148 diff --git a/rename2 b/rename3 |
05c8704a3743
handle git patches that rename a file to more than one destination
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3589
diff
changeset
|
149 rename from rename2 |
05c8704a3743
handle git patches that rename a file to more than one destination
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3589
diff
changeset
|
150 rename to rename3 |
05c8704a3743
handle git patches that rename a file to more than one destination
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3589
diff
changeset
|
151 diff --git a/rename2 b/rename3-2 |
05c8704a3743
handle git patches that rename a file to more than one destination
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3589
diff
changeset
|
152 rename from rename2 |
05c8704a3743
handle git patches that rename a file to more than one destination
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3589
diff
changeset
|
153 rename to rename3-2 |
05c8704a3743
handle git patches that rename a file to more than one destination
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3589
diff
changeset
|
154 EOF |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
155 hg tip -q |
10061
9e2ab10728a2
Make {file_copies} usable as a --template key
Patrick Mezard <pmezard@gmail.com>
parents:
10060
diff
changeset
|
156 hg log -vr. --template '{rev} {files} / {file_copies}\n' |
3701
05c8704a3743
handle git patches that rename a file to more than one destination
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3589
diff
changeset
|
157 |
05c8704a3743
handle git patches that rename a file to more than one destination
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3589
diff
changeset
|
158 hg locate rename2 rename3 rename3-2 |
05c8704a3743
handle git patches that rename a file to more than one destination
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3589
diff
changeset
|
159 hg cat rename3 |
05c8704a3743
handle git patches that rename a file to more than one destination
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3589
diff
changeset
|
160 echo |
05c8704a3743
handle git patches that rename a file to more than one destination
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3589
diff
changeset
|
161 hg cat rename3-2 |
3716
ab5600428b08
handle files with both git binary patches and copy/rename ops
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3701
diff
changeset
|
162 |
ab5600428b08
handle files with both git binary patches and copy/rename ops
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3701
diff
changeset
|
163 echo foo > foo |
ab5600428b08
handle files with both git binary patches and copy/rename ops
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3701
diff
changeset
|
164 hg add foo |
ab5600428b08
handle files with both git binary patches and copy/rename ops
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3701
diff
changeset
|
165 hg ci -m 'add foo' |
ab5600428b08
handle files with both git binary patches and copy/rename ops
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3701
diff
changeset
|
166 echo % binary files and regular patch hunks |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
167 hg import -d "1000000 0" -m binaryregular - <<EOF |
3716
ab5600428b08
handle files with both git binary patches and copy/rename ops
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3701
diff
changeset
|
168 diff --git a/binary b/binary |
ab5600428b08
handle files with both git binary patches and copy/rename ops
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3701
diff
changeset
|
169 new file mode 100644 |
ab5600428b08
handle files with both git binary patches and copy/rename ops
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3701
diff
changeset
|
170 index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4 |
ab5600428b08
handle files with both git binary patches and copy/rename ops
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3701
diff
changeset
|
171 GIT binary patch |
ab5600428b08
handle files with both git binary patches and copy/rename ops
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3701
diff
changeset
|
172 literal 4 |
ab5600428b08
handle files with both git binary patches and copy/rename ops
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3701
diff
changeset
|
173 Lc\${NkU|;|M00aO5 |
ab5600428b08
handle files with both git binary patches and copy/rename ops
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3701
diff
changeset
|
174 |
ab5600428b08
handle files with both git binary patches and copy/rename ops
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3701
diff
changeset
|
175 diff --git a/foo b/foo2 |
ab5600428b08
handle files with both git binary patches and copy/rename ops
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3701
diff
changeset
|
176 rename from foo |
ab5600428b08
handle files with both git binary patches and copy/rename ops
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3701
diff
changeset
|
177 rename to foo2 |
ab5600428b08
handle files with both git binary patches and copy/rename ops
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3701
diff
changeset
|
178 EOF |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
179 hg tip -q |
3716
ab5600428b08
handle files with both git binary patches and copy/rename ops
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3701
diff
changeset
|
180 cat foo2 |
3736 | 181 hg manifest --debug | grep binary |
3717
9e248cfd8b94
handle files with more than one git binary patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3716
diff
changeset
|
182 |
9e248cfd8b94
handle files with more than one git binary patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3716
diff
changeset
|
183 echo % many binary files |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
184 hg import -d "1000000 0" -m multibinary - <<EOF |
3717
9e248cfd8b94
handle files with more than one git binary patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3716
diff
changeset
|
185 diff --git a/mbinary1 b/mbinary1 |
9e248cfd8b94
handle files with more than one git binary patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3716
diff
changeset
|
186 new file mode 100644 |
9e248cfd8b94
handle files with more than one git binary patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3716
diff
changeset
|
187 index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4 |
9e248cfd8b94
handle files with more than one git binary patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3716
diff
changeset
|
188 GIT binary patch |
9e248cfd8b94
handle files with more than one git binary patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3716
diff
changeset
|
189 literal 4 |
9e248cfd8b94
handle files with more than one git binary patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3716
diff
changeset
|
190 Lc\${NkU|;|M00aO5 |
9e248cfd8b94
handle files with more than one git binary patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3716
diff
changeset
|
191 |
9e248cfd8b94
handle files with more than one git binary patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3716
diff
changeset
|
192 diff --git a/mbinary2 b/mbinary2 |
9e248cfd8b94
handle files with more than one git binary patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3716
diff
changeset
|
193 new file mode 100644 |
9e248cfd8b94
handle files with more than one git binary patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3716
diff
changeset
|
194 index 0000000000000000000000000000000000000000..112363ac1917b417ffbd7f376ca786a1e5fa7490 |
9e248cfd8b94
handle files with more than one git binary patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3716
diff
changeset
|
195 GIT binary patch |
9e248cfd8b94
handle files with more than one git binary patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3716
diff
changeset
|
196 literal 5 |
9e248cfd8b94
handle files with more than one git binary patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3716
diff
changeset
|
197 Mc\${NkU|\`?^000jF3jhEB |
9e248cfd8b94
handle files with more than one git binary patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3716
diff
changeset
|
198 |
9e248cfd8b94
handle files with more than one git binary patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3716
diff
changeset
|
199 EOF |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
200 hg tip -q |
3736 | 201 hg manifest --debug | grep mbinary |
4679
826659bd8053
git patches: correct handling of filenames with spaces
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3736
diff
changeset
|
202 |
826659bd8053
git patches: correct handling of filenames with spaces
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3736
diff
changeset
|
203 echo % filenames with spaces |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
204 hg import -d "1000000 0" -m spaces - <<EOF |
4679
826659bd8053
git patches: correct handling of filenames with spaces
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3736
diff
changeset
|
205 diff --git a/foo bar b/foo bar |
826659bd8053
git patches: correct handling of filenames with spaces
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3736
diff
changeset
|
206 new file mode 100644 |
826659bd8053
git patches: correct handling of filenames with spaces
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3736
diff
changeset
|
207 index 0000000..257cc56 |
826659bd8053
git patches: correct handling of filenames with spaces
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3736
diff
changeset
|
208 --- /dev/null |
826659bd8053
git patches: correct handling of filenames with spaces
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3736
diff
changeset
|
209 +++ b/foo bar |
826659bd8053
git patches: correct handling of filenames with spaces
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3736
diff
changeset
|
210 @@ -0,0 +1 @@ |
826659bd8053
git patches: correct handling of filenames with spaces
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3736
diff
changeset
|
211 +foo |
826659bd8053
git patches: correct handling of filenames with spaces
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3736
diff
changeset
|
212 EOF |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
213 hg tip -q |
4679
826659bd8053
git patches: correct handling of filenames with spaces
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3736
diff
changeset
|
214 cat "foo bar" |
826659bd8053
git patches: correct handling of filenames with spaces
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3736
diff
changeset
|
215 |
5403
477136fa6571
Always copy the necessary files before applying a git patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5073
diff
changeset
|
216 echo % copy then modify the original file |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
217 hg import -d "1000000 0" -m copy-mod-orig - <<EOF |
5403
477136fa6571
Always copy the necessary files before applying a git patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5073
diff
changeset
|
218 diff --git a/foo2 b/foo2 |
477136fa6571
Always copy the necessary files before applying a git patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5073
diff
changeset
|
219 index 257cc56..fe08ec6 100644 |
477136fa6571
Always copy the necessary files before applying a git patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5073
diff
changeset
|
220 --- a/foo2 |
477136fa6571
Always copy the necessary files before applying a git patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5073
diff
changeset
|
221 +++ b/foo2 |
477136fa6571
Always copy the necessary files before applying a git patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5073
diff
changeset
|
222 @@ -1 +1,2 @@ |
477136fa6571
Always copy the necessary files before applying a git patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5073
diff
changeset
|
223 foo |
477136fa6571
Always copy the necessary files before applying a git patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5073
diff
changeset
|
224 +new line |
477136fa6571
Always copy the necessary files before applying a git patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5073
diff
changeset
|
225 diff --git a/foo2 b/foo3 |
477136fa6571
Always copy the necessary files before applying a git patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5073
diff
changeset
|
226 similarity index 100% |
477136fa6571
Always copy the necessary files before applying a git patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5073
diff
changeset
|
227 copy from foo2 |
477136fa6571
Always copy the necessary files before applying a git patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5073
diff
changeset
|
228 copy to foo3 |
477136fa6571
Always copy the necessary files before applying a git patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5073
diff
changeset
|
229 EOF |
10928
377d879e9d1b
test-git-import: better testing, check nodeids
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
10061
diff
changeset
|
230 hg tip -q |
12574
77600d697d0e
patch: fix rename text to binary file (issue2400)
Patrick Mezard <pmezard@gmail.com>
parents:
10928
diff
changeset
|
231 cat foo3 |
5403
477136fa6571
Always copy the necessary files before applying a git patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5073
diff
changeset
|
232 |
12574
77600d697d0e
patch: fix rename text to binary file (issue2400)
Patrick Mezard <pmezard@gmail.com>
parents:
10928
diff
changeset
|
233 echo % move text file and patch as binary |
77600d697d0e
patch: fix rename text to binary file (issue2400)
Patrick Mezard <pmezard@gmail.com>
parents:
10928
diff
changeset
|
234 echo a > text2 |
77600d697d0e
patch: fix rename text to binary file (issue2400)
Patrick Mezard <pmezard@gmail.com>
parents:
10928
diff
changeset
|
235 hg ci -Am0 |
77600d697d0e
patch: fix rename text to binary file (issue2400)
Patrick Mezard <pmezard@gmail.com>
parents:
10928
diff
changeset
|
236 hg import -d "1000000 0" -m rename-as-binary - <<"EOF" |
77600d697d0e
patch: fix rename text to binary file (issue2400)
Patrick Mezard <pmezard@gmail.com>
parents:
10928
diff
changeset
|
237 diff --git a/text2 b/binary2 |
77600d697d0e
patch: fix rename text to binary file (issue2400)
Patrick Mezard <pmezard@gmail.com>
parents:
10928
diff
changeset
|
238 rename from text2 |
77600d697d0e
patch: fix rename text to binary file (issue2400)
Patrick Mezard <pmezard@gmail.com>
parents:
10928
diff
changeset
|
239 rename to binary2 |
77600d697d0e
patch: fix rename text to binary file (issue2400)
Patrick Mezard <pmezard@gmail.com>
parents:
10928
diff
changeset
|
240 index 78981922613b2afb6025042ff6bd878ac1994e85..10efcb362e9f3b3420fcfbfc0e37f3dc16e29757 |
77600d697d0e
patch: fix rename text to binary file (issue2400)
Patrick Mezard <pmezard@gmail.com>
parents:
10928
diff
changeset
|
241 GIT binary patch |
77600d697d0e
patch: fix rename text to binary file (issue2400)
Patrick Mezard <pmezard@gmail.com>
parents:
10928
diff
changeset
|
242 literal 5 |
77600d697d0e
patch: fix rename text to binary file (issue2400)
Patrick Mezard <pmezard@gmail.com>
parents:
10928
diff
changeset
|
243 Mc$`b*O5$Pw00T?_*Z=?k |
77600d697d0e
patch: fix rename text to binary file (issue2400)
Patrick Mezard <pmezard@gmail.com>
parents:
10928
diff
changeset
|
244 |
77600d697d0e
patch: fix rename text to binary file (issue2400)
Patrick Mezard <pmezard@gmail.com>
parents:
10928
diff
changeset
|
245 EOF |
77600d697d0e
patch: fix rename text to binary file (issue2400)
Patrick Mezard <pmezard@gmail.com>
parents:
10928
diff
changeset
|
246 cat binary2 | repr |
77600d697d0e
patch: fix rename text to binary file (issue2400)
Patrick Mezard <pmezard@gmail.com>
parents:
10928
diff
changeset
|
247 hg st --copies --change . |