Show More
@@ -1,497 +1,497 | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 | hg init a |
|
3 | hg init a | |
4 | mkdir a/d1 |
|
4 | mkdir a/d1 | |
5 | mkdir a/d1/d2 |
|
5 | mkdir a/d1/d2 | |
6 | echo line 1 > a/a |
|
6 | echo line 1 > a/a | |
7 | echo line 1 > a/d1/d2/a |
|
7 | echo line 1 > a/d1/d2/a | |
8 | hg --cwd a ci -Ama |
|
8 | hg --cwd a ci -Ama | |
9 |
|
9 | |||
10 | echo line 2 >> a/a |
|
10 | echo line 2 >> a/a | |
11 | hg --cwd a ci -u someone -d '1 0' -m'second change' |
|
11 | hg --cwd a ci -u someone -d '1 0' -m'second change' | |
12 |
|
12 | |||
13 | echo % import exported patch |
|
13 | echo % import exported patch | |
14 | hg clone -r0 a b |
|
14 | hg clone -r0 a b | |
15 | hg --cwd a export tip > tip.patch |
|
15 | hg --cwd a export tip > tip.patch | |
16 | hg --cwd b import ../tip.patch |
|
16 | hg --cwd b import ../tip.patch | |
17 | echo % message should be same |
|
17 | echo % message should be same | |
18 | hg --cwd b tip | grep 'second change' |
|
18 | hg --cwd b tip | grep 'second change' | |
19 | echo % committer should be same |
|
19 | echo % committer should be same | |
20 | hg --cwd b tip | grep someone |
|
20 | hg --cwd b tip | grep someone | |
21 | rm -r b |
|
21 | rm -r b | |
22 |
|
22 | |||
23 | echo % import exported patch with external patcher |
|
23 | echo % import exported patch with external patcher | |
24 | cat > dummypatch.py <<EOF |
|
24 | cat > dummypatch.py <<EOF | |
25 | print 'patching file a' |
|
25 | print 'patching file a' | |
26 | file('a', 'wb').write('line2\n') |
|
26 | file('a', 'wb').write('line2\n') | |
27 | EOF |
|
27 | EOF | |
28 | chmod +x dummypatch.py |
|
28 | chmod +x dummypatch.py | |
29 | hg clone -r0 a b |
|
29 | hg clone -r0 a b | |
30 | hg --cwd a export tip > tip.patch |
|
30 | hg --cwd a export tip > tip.patch | |
31 | hg --config ui.patch='python ../dummypatch.py' --cwd b import ../tip.patch |
|
31 | hg --config ui.patch='python ../dummypatch.py' --cwd b import ../tip.patch | |
32 | cat b/a |
|
32 | cat b/a | |
33 | rm -r b |
|
33 | rm -r b | |
34 |
|
34 | |||
35 | echo % import of plain diff should fail without message |
|
35 | echo % import of plain diff should fail without message | |
36 | hg clone -r0 a b |
|
36 | hg clone -r0 a b | |
37 | hg --cwd a diff -r0:1 > tip.patch |
|
37 | hg --cwd a diff -r0:1 > tip.patch | |
38 | hg --cwd b import ../tip.patch |
|
38 | hg --cwd b import ../tip.patch | |
39 | rm -r b |
|
39 | rm -r b | |
40 |
|
40 | |||
41 | echo % import of plain diff should be ok with message |
|
41 | echo % import of plain diff should be ok with message | |
42 | hg clone -r0 a b |
|
42 | hg clone -r0 a b | |
43 | hg --cwd a diff -r0:1 > tip.patch |
|
43 | hg --cwd a diff -r0:1 > tip.patch | |
44 | hg --cwd b import -mpatch ../tip.patch |
|
44 | hg --cwd b import -mpatch ../tip.patch | |
45 | rm -r b |
|
45 | rm -r b | |
46 |
|
46 | |||
47 | echo % import of plain diff with specific date and user |
|
47 | echo % import of plain diff with specific date and user | |
48 | hg clone -r0 a b |
|
48 | hg clone -r0 a b | |
49 | hg --cwd a diff -r0:1 > tip.patch |
|
49 | hg --cwd a diff -r0:1 > tip.patch | |
50 | hg --cwd b import -mpatch -d '1 0' -u 'user@nowhere.net' ../tip.patch |
|
50 | hg --cwd b import -mpatch -d '1 0' -u 'user@nowhere.net' ../tip.patch | |
51 | hg -R b tip -pv |
|
51 | hg -R b tip -pv | |
52 | rm -r b |
|
52 | rm -r b | |
53 |
|
53 | |||
54 | echo % import of plain diff should be ok with --no-commit |
|
54 | echo % import of plain diff should be ok with --no-commit | |
55 | hg clone -r0 a b |
|
55 | hg clone -r0 a b | |
56 | hg --cwd a diff -r0:1 > tip.patch |
|
56 | hg --cwd a diff -r0:1 > tip.patch | |
57 | hg --cwd b import --no-commit ../tip.patch |
|
57 | hg --cwd b import --no-commit ../tip.patch | |
58 | hg --cwd b diff --nodates |
|
58 | hg --cwd b diff --nodates | |
59 | rm -r b |
|
59 | rm -r b | |
60 |
|
60 | |||
61 | echo % hg -R repo import |
|
61 | echo % hg -R repo import | |
62 | # put the clone in a subdir - having a directory named "a" |
|
62 | # put the clone in a subdir - having a directory named "a" | |
63 | # used to hide a bug. |
|
63 | # used to hide a bug. | |
64 | mkdir dir |
|
64 | mkdir dir | |
65 | hg clone -r0 a dir/b |
|
65 | hg clone -r0 a dir/b | |
66 | hg --cwd a export tip > dir/tip.patch |
|
66 | hg --cwd a export tip > dir/tip.patch | |
67 | cd dir |
|
67 | cd dir | |
68 | hg -R b import tip.patch |
|
68 | hg -R b import tip.patch | |
69 | cd .. |
|
69 | cd .. | |
70 | rm -r dir |
|
70 | rm -r dir | |
71 |
|
71 | |||
72 | echo % import from stdin |
|
72 | echo % import from stdin | |
73 | hg clone -r0 a b |
|
73 | hg clone -r0 a b | |
74 | hg --cwd a export tip | hg --cwd b import - |
|
74 | hg --cwd a export tip | hg --cwd b import - | |
75 | rm -r b |
|
75 | rm -r b | |
76 |
|
76 | |||
77 | echo % import two patches in one stream |
|
77 | echo % import two patches in one stream | |
78 | hg init b |
|
78 | hg init b | |
79 | hg --cwd a export 0:tip | hg --cwd b import - |
|
79 | hg --cwd a export 0:tip | hg --cwd b import - | |
80 | hg --cwd a id |
|
80 | hg --cwd a id | |
81 | hg --cwd b id |
|
81 | hg --cwd b id | |
82 | rm -r b |
|
82 | rm -r b | |
83 |
|
83 | |||
84 | echo % override commit message |
|
84 | echo % override commit message | |
85 | hg clone -r0 a b |
|
85 | hg clone -r0 a b | |
86 | hg --cwd a export tip | hg --cwd b import -m 'override' - |
|
86 | hg --cwd a export tip | hg --cwd b import -m 'override' - | |
87 | hg --cwd b tip | grep override |
|
87 | hg --cwd b tip | grep override | |
88 | rm -r b |
|
88 | rm -r b | |
89 |
|
89 | |||
90 | cat > mkmsg.py <<EOF |
|
90 | cat > mkmsg.py <<EOF | |
91 | import email.Message, sys |
|
91 | import email.Message, sys | |
92 | msg = email.Message.Message() |
|
92 | msg = email.Message.Message() | |
93 | msg.set_payload('email commit message\n' + open('tip.patch', 'rb').read()) |
|
93 | msg.set_payload('email commit message\n' + open('tip.patch', 'rb').read()) | |
94 | msg['Subject'] = 'email patch' |
|
94 | msg['Subject'] = 'email patch' | |
95 | msg['From'] = 'email patcher' |
|
95 | msg['From'] = 'email patcher' | |
96 | sys.stdout.write(msg.as_string()) |
|
96 | sys.stdout.write(msg.as_string()) | |
97 | EOF |
|
97 | EOF | |
98 |
|
98 | |||
99 | echo % plain diff in email, subject, message body |
|
99 | echo % plain diff in email, subject, message body | |
100 | hg clone -r0 a b |
|
100 | hg clone -r0 a b | |
101 | hg --cwd a diff -r0:1 > tip.patch |
|
101 | hg --cwd a diff -r0:1 > tip.patch | |
102 | python mkmsg.py > msg.patch |
|
102 | python mkmsg.py > msg.patch | |
103 | hg --cwd b import ../msg.patch |
|
103 | hg --cwd b import ../msg.patch | |
104 | hg --cwd b tip | grep email |
|
104 | hg --cwd b tip | grep email | |
105 | rm -r b |
|
105 | rm -r b | |
106 |
|
106 | |||
107 | echo % plain diff in email, no subject, message body |
|
107 | echo % plain diff in email, no subject, message body | |
108 | hg clone -r0 a b |
|
108 | hg clone -r0 a b | |
109 | grep -v '^Subject:' msg.patch | hg --cwd b import - |
|
109 | grep -v '^Subject:' msg.patch | hg --cwd b import - | |
110 | rm -r b |
|
110 | rm -r b | |
111 |
|
111 | |||
112 | echo % plain diff in email, subject, no message body |
|
112 | echo % plain diff in email, subject, no message body | |
113 | hg clone -r0 a b |
|
113 | hg clone -r0 a b | |
114 | grep -v '^email ' msg.patch | hg --cwd b import - |
|
114 | grep -v '^email ' msg.patch | hg --cwd b import - | |
115 | rm -r b |
|
115 | rm -r b | |
116 |
|
116 | |||
117 | echo % plain diff in email, no subject, no message body, should fail |
|
117 | echo % plain diff in email, no subject, no message body, should fail | |
118 | hg clone -r0 a b |
|
118 | hg clone -r0 a b | |
119 | egrep -v '^(Subject|email)' msg.patch | hg --cwd b import - |
|
119 | egrep -v '^(Subject|email)' msg.patch | hg --cwd b import - | |
120 | rm -r b |
|
120 | rm -r b | |
121 |
|
121 | |||
122 | echo % hg export in email, should use patch header |
|
122 | echo % hg export in email, should use patch header | |
123 | hg clone -r0 a b |
|
123 | hg clone -r0 a b | |
124 | hg --cwd a export tip > tip.patch |
|
124 | hg --cwd a export tip > tip.patch | |
125 | python mkmsg.py | hg --cwd b import - |
|
125 | python mkmsg.py | hg --cwd b import - | |
126 | hg --cwd b tip | grep second |
|
126 | hg --cwd b tip | grep second | |
127 | rm -r b |
|
127 | rm -r b | |
128 |
|
128 | |||
129 | # subject: duplicate detection, removal of [PATCH] |
|
129 | # subject: duplicate detection, removal of [PATCH] | |
130 | # The '---' tests the gitsendmail handling without proper mail headers |
|
130 | # The '---' tests the gitsendmail handling without proper mail headers | |
131 | cat > mkmsg2.py <<EOF |
|
131 | cat > mkmsg2.py <<EOF | |
132 | import email.Message, sys |
|
132 | import email.Message, sys | |
133 | msg = email.Message.Message() |
|
133 | msg = email.Message.Message() | |
134 | msg.set_payload('email patch\n\nnext line\n---\n' + open('tip.patch').read()) |
|
134 | msg.set_payload('email patch\n\nnext line\n---\n' + open('tip.patch').read()) | |
135 | msg['Subject'] = '[PATCH] email patch' |
|
135 | msg['Subject'] = '[PATCH] email patch' | |
136 | msg['From'] = 'email patcher' |
|
136 | msg['From'] = 'email patcher' | |
137 | sys.stdout.write(msg.as_string()) |
|
137 | sys.stdout.write(msg.as_string()) | |
138 | EOF |
|
138 | EOF | |
139 |
|
139 | |||
140 | echo '% plain diff in email, [PATCH] subject, message body with subject' |
|
140 | echo '% plain diff in email, [PATCH] subject, message body with subject' | |
141 | hg clone -r0 a b |
|
141 | hg clone -r0 a b | |
142 | hg --cwd a diff -r0:1 > tip.patch |
|
142 | hg --cwd a diff -r0:1 > tip.patch | |
143 | python mkmsg2.py | hg --cwd b import - |
|
143 | python mkmsg2.py | hg --cwd b import - | |
144 | hg --cwd b tip --template '{desc}\n' |
|
144 | hg --cwd b tip --template '{desc}\n' | |
145 | rm -r b |
|
145 | rm -r b | |
146 |
|
146 | |||
147 | # We weren't backing up the correct dirstate file when importing many patches |
|
147 | # We weren't backing up the correct dirstate file when importing many patches | |
148 | # (issue963) |
|
148 | # (issue963) | |
149 | echo '% import patch1 patch2; rollback' |
|
149 | echo '% import patch1 patch2; rollback' | |
150 | echo line 3 >> a/a |
|
150 | echo line 3 >> a/a | |
151 | hg --cwd a ci -m'third change' |
|
151 | hg --cwd a ci -m'third change' | |
152 | hg --cwd a export -o '../patch%R' 1 2 |
|
152 | hg --cwd a export -o '../patch%R' 1 2 | |
153 | hg clone -qr0 a b |
|
153 | hg clone -qr0 a b | |
154 | hg --cwd b parents --template 'parent: {rev}\n' |
|
154 | hg --cwd b parents --template 'parent: {rev}\n' | |
155 | hg --cwd b import ../patch1 ../patch2 |
|
155 | hg --cwd b import ../patch1 ../patch2 | |
156 | hg --cwd b rollback |
|
156 | hg --cwd b rollback | |
157 | hg --cwd b parents --template 'parent: {rev}\n' |
|
157 | hg --cwd b parents --template 'parent: {rev}\n' | |
158 | rm -r b |
|
158 | rm -r b | |
159 |
|
159 | |||
160 | # bug non regression test |
|
160 | # bug non regression test | |
161 | # importing a patch in a subdirectory failed at the commit stage |
|
161 | # importing a patch in a subdirectory failed at the commit stage | |
162 | echo line 2 >> a/d1/d2/a |
|
162 | echo line 2 >> a/d1/d2/a | |
163 | hg --cwd a ci -u someoneelse -d '1 0' -m'subdir change' |
|
163 | hg --cwd a ci -u someoneelse -d '1 0' -m'subdir change' | |
164 | echo % hg import in a subdirectory |
|
164 | echo % hg import in a subdirectory | |
165 | hg clone -r0 a b |
|
165 | hg clone -r0 a b | |
166 | hg --cwd a export tip | sed -e 's/d1\/d2\///' > tip.patch |
|
166 | hg --cwd a export tip | sed -e 's/d1\/d2\///' > tip.patch | |
167 | dir=`pwd` |
|
167 | dir=`pwd` | |
168 | cd b/d1/d2 2>&1 > /dev/null |
|
168 | cd b/d1/d2 2>&1 > /dev/null | |
169 | hg import ../../../tip.patch |
|
169 | hg import ../../../tip.patch | |
170 | cd "$dir" |
|
170 | cd "$dir" | |
171 | echo "% message should be 'subdir change'" |
|
171 | echo "% message should be 'subdir change'" | |
172 | hg --cwd b tip | grep 'subdir change' |
|
172 | hg --cwd b tip | grep 'subdir change' | |
173 | echo "% committer should be 'someoneelse'" |
|
173 | echo "% committer should be 'someoneelse'" | |
174 | hg --cwd b tip | grep someoneelse |
|
174 | hg --cwd b tip | grep someoneelse | |
175 | echo "% should be empty" |
|
175 | echo "% should be empty" | |
176 | hg --cwd b status |
|
176 | hg --cwd b status | |
177 |
|
177 | |||
178 |
|
178 | |||
179 | # Test fuzziness (ambiguous patch location, fuzz=2) |
|
179 | # Test fuzziness (ambiguous patch location, fuzz=2) | |
180 | echo % test fuzziness |
|
180 | echo % test fuzziness | |
181 | hg init fuzzy |
|
181 | hg init fuzzy | |
182 | cd fuzzy |
|
182 | cd fuzzy | |
183 | echo line1 > a |
|
183 | echo line1 > a | |
184 | echo line0 >> a |
|
184 | echo line0 >> a | |
185 | echo line3 >> a |
|
185 | echo line3 >> a | |
186 | hg ci -Am adda |
|
186 | hg ci -Am adda | |
187 | echo line1 > a |
|
187 | echo line1 > a | |
188 | echo line2 >> a |
|
188 | echo line2 >> a | |
189 | echo line0 >> a |
|
189 | echo line0 >> a | |
190 | echo line3 >> a |
|
190 | echo line3 >> a | |
191 | hg ci -m change a |
|
191 | hg ci -m change a | |
192 | hg export tip > tip.patch |
|
192 | hg export tip > tip.patch | |
193 | hg up -C 0 |
|
193 | hg up -C 0 | |
194 | echo line1 > a |
|
194 | echo line1 > a | |
195 | echo line0 >> a |
|
195 | echo line0 >> a | |
196 | echo line1 >> a |
|
196 | echo line1 >> a | |
197 | echo line0 >> a |
|
197 | echo line0 >> a | |
198 | hg ci -m brancha |
|
198 | hg ci -m brancha | |
199 | hg import --no-commit -v tip.patch |
|
199 | hg import --no-commit -v tip.patch | |
200 | hg revert -a |
|
200 | hg revert -a | |
201 | echo '% test fuzziness with eol=auto' |
|
201 | echo '% test fuzziness with eol=auto' | |
202 | hg --config patch.eol=auto import --no-commit -v tip.patch |
|
202 | hg --config patch.eol=auto import --no-commit -v tip.patch | |
203 | cd .. |
|
203 | cd .. | |
204 |
|
204 | |||
205 | # Test hunk touching empty files (issue906) |
|
205 | # Test hunk touching empty files (issue906) | |
206 | hg init empty |
|
206 | hg init empty | |
207 | cd empty |
|
207 | cd empty | |
208 | touch a |
|
208 | touch a | |
209 | touch b1 |
|
209 | touch b1 | |
210 | touch c1 |
|
210 | touch c1 | |
211 | echo d > d |
|
211 | echo d > d | |
212 | hg ci -Am init |
|
212 | hg ci -Am init | |
213 | echo a > a |
|
213 | echo a > a | |
214 | echo b > b1 |
|
214 | echo b > b1 | |
215 | hg mv b1 b2 |
|
215 | hg mv b1 b2 | |
216 | echo c > c1 |
|
216 | echo c > c1 | |
217 | hg copy c1 c2 |
|
217 | hg copy c1 c2 | |
218 | rm d |
|
218 | rm d | |
219 | touch d |
|
219 | touch d | |
220 | hg diff --git |
|
220 | hg diff --git | |
221 | hg ci -m empty |
|
221 | hg ci -m empty | |
222 | hg export --git tip > empty.diff |
|
222 | hg export --git tip > empty.diff | |
223 | hg up -C 0 |
|
223 | hg up -C 0 | |
224 | hg import empty.diff |
|
224 | hg import empty.diff | |
225 | for name in a b1 b2 c1 c2 d; |
|
225 | for name in a b1 b2 c1 c2 d; | |
226 | do |
|
226 | do | |
227 | echo % $name file |
|
227 | echo % $name file | |
228 | test -f $name && cat $name |
|
228 | test -f $name && cat $name | |
229 | done |
|
229 | done | |
230 | cd .. |
|
230 | cd .. | |
231 |
|
231 | |||
232 | # Test importing a patch ending with a binary file removal |
|
232 | # Test importing a patch ending with a binary file removal | |
233 | echo % test trailing binary removal |
|
233 | echo % test trailing binary removal | |
234 | hg init binaryremoval |
|
234 | hg init binaryremoval | |
235 | cd binaryremoval |
|
235 | cd binaryremoval | |
236 | echo a > a |
|
236 | echo a > a | |
237 | python -c "file('b', 'wb').write('a\x00b')" |
|
237 | python -c "file('b', 'wb').write('a\x00b')" | |
238 | hg ci -Am addall |
|
238 | hg ci -Am addall | |
239 | hg rm a |
|
239 | hg rm a | |
240 | hg rm b |
|
240 | hg rm b | |
241 | hg st |
|
241 | hg st | |
242 | hg ci -m remove |
|
242 | hg ci -m remove | |
243 | hg export --git . > remove.diff |
|
243 | hg export --git . > remove.diff | |
244 | cat remove.diff | grep git |
|
244 | cat remove.diff | grep git | |
245 | hg up -C 0 |
|
245 | hg up -C 0 | |
246 | hg import remove.diff |
|
246 | hg import remove.diff | |
247 | hg manifest |
|
247 | hg manifest | |
248 | cd .. |
|
248 | cd .. | |
249 |
|
249 | |||
250 | echo % 'test update+rename with common name (issue 927)' |
|
250 | echo % 'test update+rename with common name (issue 927)' | |
251 | hg init t |
|
251 | hg init t | |
252 | cd t |
|
252 | cd t | |
253 | touch a |
|
253 | touch a | |
254 | hg ci -Am t |
|
254 | hg ci -Am t | |
255 | echo a > a |
|
255 | echo a > a | |
256 | # Here, bfile.startswith(afile) |
|
256 | # Here, bfile.startswith(afile) | |
257 | hg copy a a2 |
|
257 | hg copy a a2 | |
258 | hg ci -m copya |
|
258 | hg ci -m copya | |
259 | hg export --git tip > copy.diff |
|
259 | hg export --git tip > copy.diff | |
260 | hg up -C 0 |
|
260 | hg up -C 0 | |
261 | hg import copy.diff |
|
261 | hg import copy.diff | |
262 | echo % view a |
|
262 | echo % view a | |
263 | # a should contain an 'a' |
|
263 | # a should contain an 'a' | |
264 | cat a |
|
264 | cat a | |
265 | echo % view a2 |
|
265 | echo % view a2 | |
266 | # and a2 should have duplicated it |
|
266 | # and a2 should have duplicated it | |
267 | cat a2 |
|
267 | cat a2 | |
268 | cd .. |
|
268 | cd .. | |
269 |
|
269 | |||
270 | echo % 'test -p0' |
|
270 | echo % 'test -p0' | |
271 | hg init p0 |
|
271 | hg init p0 | |
272 | cd p0 |
|
272 | cd p0 | |
273 | echo a > a |
|
273 | echo a > a | |
274 | hg ci -Am t |
|
274 | hg ci -Am t | |
275 | hg import -p0 - << EOF |
|
275 | hg import -p0 - << EOF | |
276 | foobar |
|
276 | foobar | |
277 | --- a Sat Apr 12 22:43:58 2008 -0400 |
|
277 | --- a Sat Apr 12 22:43:58 2008 -0400 | |
278 | +++ a Sat Apr 12 22:44:05 2008 -0400 |
|
278 | +++ a Sat Apr 12 22:44:05 2008 -0400 | |
279 | @@ -1,1 +1,1 @@ |
|
279 | @@ -1,1 +1,1 @@ | |
280 | -a |
|
280 | -a | |
281 | +bb |
|
281 | +bb | |
282 | EOF |
|
282 | EOF | |
283 | hg status |
|
283 | hg status | |
284 | cat a |
|
284 | cat a | |
285 | cd .. |
|
285 | cd .. | |
286 |
|
286 | |||
287 | echo % 'test paths outside repo root' |
|
287 | echo % 'test paths outside repo root' | |
288 | mkdir outside |
|
288 | mkdir outside | |
289 | touch outside/foo |
|
289 | touch outside/foo | |
290 | hg init inside |
|
290 | hg init inside | |
291 | cd inside |
|
291 | cd inside | |
292 | hg import - <<EOF |
|
292 | hg import - <<EOF | |
293 | diff --git a/a b/b |
|
293 | diff --git a/a b/b | |
294 | rename from ../outside/foo |
|
294 | rename from ../outside/foo | |
295 | rename to bar |
|
295 | rename to bar | |
296 | EOF |
|
296 | EOF | |
297 | cd .. |
|
297 | cd .. | |
298 |
|
298 | |||
299 | echo '% test import with similarity (issue295)' |
|
299 | echo '% test import with similarity and git and strip (issue295 et al.)' | |
300 | hg init sim |
|
300 | hg init sim | |
301 | cd sim |
|
301 | cd sim | |
302 | echo 'this is a test' > a |
|
302 | echo 'this is a test' > a | |
303 | hg ci -Ama |
|
303 | hg ci -Ama | |
304 | cat > ../rename.diff <<EOF |
|
304 | cat > ../rename.diff <<EOF | |
305 | diff --git a/a b/a |
|
305 | diff --git a/foo/a b/foo/a | |
306 | deleted file mode 100644 |
|
306 | deleted file mode 100644 | |
307 | --- a/a |
|
307 | --- a/foo/a | |
308 | +++ /dev/null |
|
308 | +++ /dev/null | |
309 | @@ -1,1 +0,0 @@ |
|
309 | @@ -1,1 +0,0 @@ | |
310 | -this is a test |
|
310 | -this is a test | |
311 | diff --git a/b b/b |
|
311 | diff --git a/foo/b b/foo/b | |
312 | new file mode 100644 |
|
312 | new file mode 100644 | |
313 | --- /dev/null |
|
313 | --- /dev/null | |
314 | +++ b/b |
|
314 | +++ b/foo/b | |
315 | @@ -0,0 +1,2 @@ |
|
315 | @@ -0,0 +1,2 @@ | |
316 | +this is a test |
|
316 | +this is a test | |
317 | +foo |
|
317 | +foo | |
318 | EOF |
|
318 | EOF | |
319 | hg import --no-commit -v -s 1 ../rename.diff |
|
319 | hg import --no-commit -v -s 1 ../rename.diff -p2 | |
320 | hg st -C |
|
320 | hg st -C | |
321 | hg revert -a |
|
321 | hg revert -a | |
322 | rm b |
|
322 | rm b | |
323 | hg import --no-commit -v -s 100 ../rename.diff |
|
323 | hg import --no-commit -v -s 100 ../rename.diff -p2 | |
324 | hg st -C |
|
324 | hg st -C | |
325 | cd .. |
|
325 | cd .. | |
326 |
|
326 | |||
327 |
|
327 | |||
328 | echo '% add empty file from the end of patch (issue 1495)' |
|
328 | echo '% add empty file from the end of patch (issue 1495)' | |
329 | hg init addemptyend |
|
329 | hg init addemptyend | |
330 | cd addemptyend |
|
330 | cd addemptyend | |
331 | touch a |
|
331 | touch a | |
332 | hg addremove |
|
332 | hg addremove | |
333 | hg ci -m "commit" |
|
333 | hg ci -m "commit" | |
334 | cat > a.patch <<EOF |
|
334 | cat > a.patch <<EOF | |
335 | diff --git a/a b/a |
|
335 | diff --git a/a b/a | |
336 | --- a/a |
|
336 | --- a/a | |
337 | +++ b/a |
|
337 | +++ b/a | |
338 | @@ -0,0 +1,1 @@ |
|
338 | @@ -0,0 +1,1 @@ | |
339 | +a |
|
339 | +a | |
340 | diff --git a/b b/b |
|
340 | diff --git a/b b/b | |
341 | new file mode 100644 |
|
341 | new file mode 100644 | |
342 | EOF |
|
342 | EOF | |
343 | hg import --no-commit a.patch |
|
343 | hg import --no-commit a.patch | |
344 | cd .. |
|
344 | cd .. | |
345 |
|
345 | |||
346 | echo '% create file when source is not /dev/null' |
|
346 | echo '% create file when source is not /dev/null' | |
347 | cat > create.patch <<EOF |
|
347 | cat > create.patch <<EOF | |
348 | diff -Naur proj-orig/foo proj-new/foo |
|
348 | diff -Naur proj-orig/foo proj-new/foo | |
349 | --- proj-orig/foo 1969-12-31 16:00:00.000000000 -0800 |
|
349 | --- proj-orig/foo 1969-12-31 16:00:00.000000000 -0800 | |
350 | +++ proj-new/foo 2009-07-17 16:50:45.801368000 -0700 |
|
350 | +++ proj-new/foo 2009-07-17 16:50:45.801368000 -0700 | |
351 | @@ -0,0 +1,1 @@ |
|
351 | @@ -0,0 +1,1 @@ | |
352 | +a |
|
352 | +a | |
353 | EOF |
|
353 | EOF | |
354 | # some people have patches like the following too |
|
354 | # some people have patches like the following too | |
355 | cat > create2.patch <<EOF |
|
355 | cat > create2.patch <<EOF | |
356 | diff -Naur proj-orig/foo proj-new/foo |
|
356 | diff -Naur proj-orig/foo proj-new/foo | |
357 | --- proj-orig/foo.orig 1969-12-31 16:00:00.000000000 -0800 |
|
357 | --- proj-orig/foo.orig 1969-12-31 16:00:00.000000000 -0800 | |
358 | +++ proj-new/foo 2009-07-17 16:50:45.801368000 -0700 |
|
358 | +++ proj-new/foo 2009-07-17 16:50:45.801368000 -0700 | |
359 | @@ -0,0 +1,1 @@ |
|
359 | @@ -0,0 +1,1 @@ | |
360 | +a |
|
360 | +a | |
361 | EOF |
|
361 | EOF | |
362 | hg init oddcreate |
|
362 | hg init oddcreate | |
363 | cd oddcreate |
|
363 | cd oddcreate | |
364 | hg import --no-commit ../create.patch |
|
364 | hg import --no-commit ../create.patch | |
365 | cat foo |
|
365 | cat foo | |
366 | rm foo |
|
366 | rm foo | |
367 | hg revert foo |
|
367 | hg revert foo | |
368 | hg import --no-commit ../create2.patch |
|
368 | hg import --no-commit ../create2.patch | |
369 | cat foo |
|
369 | cat foo | |
370 |
|
370 | |||
371 | echo % 'first line mistaken for email headers (issue 1859)' |
|
371 | echo % 'first line mistaken for email headers (issue 1859)' | |
372 | hg init emailconfusion |
|
372 | hg init emailconfusion | |
373 | cd emailconfusion |
|
373 | cd emailconfusion | |
374 | cat > a.patch <<EOF |
|
374 | cat > a.patch <<EOF | |
375 | module: summary |
|
375 | module: summary | |
376 |
|
376 | |||
377 | description |
|
377 | description | |
378 |
|
378 | |||
379 |
|
379 | |||
380 | diff -r 000000000000 -r 9b4c1e343b55 test.txt |
|
380 | diff -r 000000000000 -r 9b4c1e343b55 test.txt | |
381 | --- /dev/null |
|
381 | --- /dev/null | |
382 | +++ b/a |
|
382 | +++ b/a | |
383 | @@ -0,0 +1,1 @@ |
|
383 | @@ -0,0 +1,1 @@ | |
384 | +a |
|
384 | +a | |
385 | EOF |
|
385 | EOF | |
386 | hg import -d '0 0' a.patch |
|
386 | hg import -d '0 0' a.patch | |
387 | hg parents -v |
|
387 | hg parents -v | |
388 | cd .. |
|
388 | cd .. | |
389 |
|
389 | |||
390 | echo % '--- in commit message' |
|
390 | echo % '--- in commit message' | |
391 | hg init commitconfusion |
|
391 | hg init commitconfusion | |
392 | cd commitconfusion |
|
392 | cd commitconfusion | |
393 | cat > a.patch <<EOF |
|
393 | cat > a.patch <<EOF | |
394 | module: summary |
|
394 | module: summary | |
395 |
|
395 | |||
396 | --- description |
|
396 | --- description | |
397 |
|
397 | |||
398 | diff --git a/a b/a |
|
398 | diff --git a/a b/a | |
399 | new file mode 100644 |
|
399 | new file mode 100644 | |
400 | --- /dev/null |
|
400 | --- /dev/null | |
401 | +++ b/a |
|
401 | +++ b/a | |
402 | @@ -0,0 +1,1 @@ |
|
402 | @@ -0,0 +1,1 @@ | |
403 | +a |
|
403 | +a | |
404 | EOF |
|
404 | EOF | |
405 | hg import -d '0 0' a.patch |
|
405 | hg import -d '0 0' a.patch | |
406 | hg parents -v |
|
406 | hg parents -v | |
407 | cd .. |
|
407 | cd .. | |
408 |
|
408 | |||
409 | echo '% tricky header splitting' |
|
409 | echo '% tricky header splitting' | |
410 | cat > trickyheaders.patch <<EOF |
|
410 | cat > trickyheaders.patch <<EOF | |
411 | From: User A <user@a> |
|
411 | From: User A <user@a> | |
412 | Subject: [PATCH] from: tricky! |
|
412 | Subject: [PATCH] from: tricky! | |
413 |
|
413 | |||
414 | # HG changeset patch |
|
414 | # HG changeset patch | |
415 | # User User B |
|
415 | # User User B | |
416 | # Date 1266264441 18000 |
|
416 | # Date 1266264441 18000 | |
417 | # Branch stable |
|
417 | # Branch stable | |
418 | # Node ID f2be6a1170ac83bf31cb4ae0bad00d7678115bc0 |
|
418 | # Node ID f2be6a1170ac83bf31cb4ae0bad00d7678115bc0 | |
419 | # Parent 0000000000000000000000000000000000000000 |
|
419 | # Parent 0000000000000000000000000000000000000000 | |
420 | from: tricky! |
|
420 | from: tricky! | |
421 |
|
421 | |||
422 | That is not a header. |
|
422 | That is not a header. | |
423 |
|
423 | |||
424 | diff -r 000000000000 -r f2be6a1170ac foo |
|
424 | diff -r 000000000000 -r f2be6a1170ac foo | |
425 | --- /dev/null |
|
425 | --- /dev/null | |
426 | +++ b/foo |
|
426 | +++ b/foo | |
427 | @@ -0,0 +1,1 @@ |
|
427 | @@ -0,0 +1,1 @@ | |
428 | +foo |
|
428 | +foo | |
429 | EOF |
|
429 | EOF | |
430 |
|
430 | |||
431 | hg init trickyheaders |
|
431 | hg init trickyheaders | |
432 | cd trickyheaders |
|
432 | cd trickyheaders | |
433 | hg import -d '0 0' ../trickyheaders.patch |
|
433 | hg import -d '0 0' ../trickyheaders.patch | |
434 | hg export --git tip |
|
434 | hg export --git tip | |
435 | cd .. |
|
435 | cd .. | |
436 |
|
436 | |||
437 | echo '% issue2102' |
|
437 | echo '% issue2102' | |
438 | hg init issue2102 |
|
438 | hg init issue2102 | |
439 | cd issue2102 |
|
439 | cd issue2102 | |
440 | mkdir -p src/cmd/gc |
|
440 | mkdir -p src/cmd/gc | |
441 | touch src/cmd/gc/mksys.bash |
|
441 | touch src/cmd/gc/mksys.bash | |
442 | hg ci -Am init |
|
442 | hg ci -Am init | |
443 | hg import - <<EOF |
|
443 | hg import - <<EOF | |
444 | # HG changeset patch |
|
444 | # HG changeset patch | |
445 | # User Rob Pike |
|
445 | # User Rob Pike | |
446 | # Date 1216685449 25200 |
|
446 | # Date 1216685449 25200 | |
447 | # Node ID 03aa2b206f499ad6eb50e6e207b9e710d6409c98 |
|
447 | # Node ID 03aa2b206f499ad6eb50e6e207b9e710d6409c98 | |
448 | # Parent 93d10138ad8df586827ca90b4ddb5033e21a3a84 |
|
448 | # Parent 93d10138ad8df586827ca90b4ddb5033e21a3a84 | |
449 | help management of empty pkg and lib directories in perforce |
|
449 | help management of empty pkg and lib directories in perforce | |
450 |
|
450 | |||
451 | R=gri |
|
451 | R=gri | |
452 | DELTA=4 (4 added, 0 deleted, 0 changed) |
|
452 | DELTA=4 (4 added, 0 deleted, 0 changed) | |
453 | OCL=13328 |
|
453 | OCL=13328 | |
454 | CL=13328 |
|
454 | CL=13328 | |
455 |
|
455 | |||
456 | diff --git a/lib/place-holder b/lib/place-holder |
|
456 | diff --git a/lib/place-holder b/lib/place-holder | |
457 | new file mode 100644 |
|
457 | new file mode 100644 | |
458 | --- /dev/null |
|
458 | --- /dev/null | |
459 | +++ b/lib/place-holder |
|
459 | +++ b/lib/place-holder | |
460 | @@ -0,0 +1,2 @@ |
|
460 | @@ -0,0 +1,2 @@ | |
461 | +perforce does not maintain empty directories. |
|
461 | +perforce does not maintain empty directories. | |
462 | +this file helps. |
|
462 | +this file helps. | |
463 | diff --git a/pkg/place-holder b/pkg/place-holder |
|
463 | diff --git a/pkg/place-holder b/pkg/place-holder | |
464 | new file mode 100644 |
|
464 | new file mode 100644 | |
465 | --- /dev/null |
|
465 | --- /dev/null | |
466 | +++ b/pkg/place-holder |
|
466 | +++ b/pkg/place-holder | |
467 | @@ -0,0 +1,2 @@ |
|
467 | @@ -0,0 +1,2 @@ | |
468 | +perforce does not maintain empty directories. |
|
468 | +perforce does not maintain empty directories. | |
469 | +this file helps. |
|
469 | +this file helps. | |
470 | diff --git a/src/cmd/gc/mksys.bash b/src/cmd/gc/mksys.bash |
|
470 | diff --git a/src/cmd/gc/mksys.bash b/src/cmd/gc/mksys.bash | |
471 | old mode 100644 |
|
471 | old mode 100644 | |
472 | new mode 100755 |
|
472 | new mode 100755 | |
473 | EOF |
|
473 | EOF | |
474 | hg sum |
|
474 | hg sum | |
475 | hg diff --git -c tip |
|
475 | hg diff --git -c tip | |
476 | cd .. |
|
476 | cd .. | |
477 |
|
477 | |||
478 | echo '% diff lines looking like headers' |
|
478 | echo '% diff lines looking like headers' | |
479 | hg init difflineslikeheaders |
|
479 | hg init difflineslikeheaders | |
480 | cd difflineslikeheaders |
|
480 | cd difflineslikeheaders | |
481 | echo a >a |
|
481 | echo a >a | |
482 | echo b >b |
|
482 | echo b >b | |
483 | echo c >c |
|
483 | echo c >c | |
484 | hg ci -Am1 |
|
484 | hg ci -Am1 | |
485 |
|
485 | |||
486 | echo "key: value" >>a |
|
486 | echo "key: value" >>a | |
487 | echo "key: value" >>b |
|
487 | echo "key: value" >>b | |
488 | echo "foo" >>c |
|
488 | echo "foo" >>c | |
489 | hg ci -m2 |
|
489 | hg ci -m2 | |
490 |
|
490 | |||
491 | hg up -C 0 |
|
491 | hg up -C 0 | |
492 | hg diff --git -c1 >want |
|
492 | hg diff --git -c1 >want | |
493 | hg diff -c1 | hg import --no-commit - |
|
493 | hg diff -c1 | hg import --no-commit - | |
494 | hg diff --git >have |
|
494 | hg diff --git >have | |
495 | diff want have |
|
495 | diff want have | |
496 | cd .. |
|
496 | cd .. | |
497 |
|
497 |
@@ -1,381 +1,381 | |||||
1 | adding a |
|
1 | adding a | |
2 | adding d1/d2/a |
|
2 | adding d1/d2/a | |
3 | % import exported patch |
|
3 | % import exported patch | |
4 | requesting all changes |
|
4 | requesting all changes | |
5 | adding changesets |
|
5 | adding changesets | |
6 | adding manifests |
|
6 | adding manifests | |
7 | adding file changes |
|
7 | adding file changes | |
8 | added 1 changesets with 2 changes to 2 files |
|
8 | added 1 changesets with 2 changes to 2 files | |
9 | updating to branch default |
|
9 | updating to branch default | |
10 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
10 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
11 | applying ../tip.patch |
|
11 | applying ../tip.patch | |
12 | % message should be same |
|
12 | % message should be same | |
13 | summary: second change |
|
13 | summary: second change | |
14 | % committer should be same |
|
14 | % committer should be same | |
15 | user: someone |
|
15 | user: someone | |
16 | % import exported patch with external patcher |
|
16 | % import exported patch with external patcher | |
17 | requesting all changes |
|
17 | requesting all changes | |
18 | adding changesets |
|
18 | adding changesets | |
19 | adding manifests |
|
19 | adding manifests | |
20 | adding file changes |
|
20 | adding file changes | |
21 | added 1 changesets with 2 changes to 2 files |
|
21 | added 1 changesets with 2 changes to 2 files | |
22 | updating to branch default |
|
22 | updating to branch default | |
23 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
23 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
24 | applying ../tip.patch |
|
24 | applying ../tip.patch | |
25 | line2 |
|
25 | line2 | |
26 | % import of plain diff should fail without message |
|
26 | % import of plain diff should fail without message | |
27 | requesting all changes |
|
27 | requesting all changes | |
28 | adding changesets |
|
28 | adding changesets | |
29 | adding manifests |
|
29 | adding manifests | |
30 | adding file changes |
|
30 | adding file changes | |
31 | added 1 changesets with 2 changes to 2 files |
|
31 | added 1 changesets with 2 changes to 2 files | |
32 | updating to branch default |
|
32 | updating to branch default | |
33 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
33 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
34 | applying ../tip.patch |
|
34 | applying ../tip.patch | |
35 | abort: empty commit message |
|
35 | abort: empty commit message | |
36 | % import of plain diff should be ok with message |
|
36 | % import of plain diff should be ok with message | |
37 | requesting all changes |
|
37 | requesting all changes | |
38 | adding changesets |
|
38 | adding changesets | |
39 | adding manifests |
|
39 | adding manifests | |
40 | adding file changes |
|
40 | adding file changes | |
41 | added 1 changesets with 2 changes to 2 files |
|
41 | added 1 changesets with 2 changes to 2 files | |
42 | updating to branch default |
|
42 | updating to branch default | |
43 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
43 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
44 | applying ../tip.patch |
|
44 | applying ../tip.patch | |
45 | % import of plain diff with specific date and user |
|
45 | % import of plain diff with specific date and user | |
46 | requesting all changes |
|
46 | requesting all changes | |
47 | adding changesets |
|
47 | adding changesets | |
48 | adding manifests |
|
48 | adding manifests | |
49 | adding file changes |
|
49 | adding file changes | |
50 | added 1 changesets with 2 changes to 2 files |
|
50 | added 1 changesets with 2 changes to 2 files | |
51 | updating to branch default |
|
51 | updating to branch default | |
52 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
52 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
53 | applying ../tip.patch |
|
53 | applying ../tip.patch | |
54 | changeset: 1:ca68f19f3a40 |
|
54 | changeset: 1:ca68f19f3a40 | |
55 | tag: tip |
|
55 | tag: tip | |
56 | user: user@nowhere.net |
|
56 | user: user@nowhere.net | |
57 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
57 | date: Thu Jan 01 00:00:01 1970 +0000 | |
58 | files: a |
|
58 | files: a | |
59 | description: |
|
59 | description: | |
60 | patch |
|
60 | patch | |
61 |
|
61 | |||
62 |
|
62 | |||
63 | diff -r 80971e65b431 -r ca68f19f3a40 a |
|
63 | diff -r 80971e65b431 -r ca68f19f3a40 a | |
64 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
64 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
65 | +++ b/a Thu Jan 01 00:00:01 1970 +0000 |
|
65 | +++ b/a Thu Jan 01 00:00:01 1970 +0000 | |
66 | @@ -1,1 +1,2 @@ |
|
66 | @@ -1,1 +1,2 @@ | |
67 | line 1 |
|
67 | line 1 | |
68 | +line 2 |
|
68 | +line 2 | |
69 |
|
69 | |||
70 | % import of plain diff should be ok with --no-commit |
|
70 | % import of plain diff should be ok with --no-commit | |
71 | requesting all changes |
|
71 | requesting all changes | |
72 | adding changesets |
|
72 | adding changesets | |
73 | adding manifests |
|
73 | adding manifests | |
74 | adding file changes |
|
74 | adding file changes | |
75 | added 1 changesets with 2 changes to 2 files |
|
75 | added 1 changesets with 2 changes to 2 files | |
76 | updating to branch default |
|
76 | updating to branch default | |
77 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
77 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
78 | applying ../tip.patch |
|
78 | applying ../tip.patch | |
79 | diff -r 80971e65b431 a |
|
79 | diff -r 80971e65b431 a | |
80 | --- a/a |
|
80 | --- a/a | |
81 | +++ b/a |
|
81 | +++ b/a | |
82 | @@ -1,1 +1,2 @@ |
|
82 | @@ -1,1 +1,2 @@ | |
83 | line 1 |
|
83 | line 1 | |
84 | +line 2 |
|
84 | +line 2 | |
85 | % hg -R repo import |
|
85 | % hg -R repo import | |
86 | requesting all changes |
|
86 | requesting all changes | |
87 | adding changesets |
|
87 | adding changesets | |
88 | adding manifests |
|
88 | adding manifests | |
89 | adding file changes |
|
89 | adding file changes | |
90 | added 1 changesets with 2 changes to 2 files |
|
90 | added 1 changesets with 2 changes to 2 files | |
91 | updating to branch default |
|
91 | updating to branch default | |
92 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
92 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
93 | applying tip.patch |
|
93 | applying tip.patch | |
94 | % import from stdin |
|
94 | % import from stdin | |
95 | requesting all changes |
|
95 | requesting all changes | |
96 | adding changesets |
|
96 | adding changesets | |
97 | adding manifests |
|
97 | adding manifests | |
98 | adding file changes |
|
98 | adding file changes | |
99 | added 1 changesets with 2 changes to 2 files |
|
99 | added 1 changesets with 2 changes to 2 files | |
100 | updating to branch default |
|
100 | updating to branch default | |
101 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
101 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
102 | applying patch from stdin |
|
102 | applying patch from stdin | |
103 | % import two patches in one stream |
|
103 | % import two patches in one stream | |
104 | applying patch from stdin |
|
104 | applying patch from stdin | |
105 | applied 80971e65b431 |
|
105 | applied 80971e65b431 | |
106 | 1d4bd90af0e4 tip |
|
106 | 1d4bd90af0e4 tip | |
107 | 1d4bd90af0e4 tip |
|
107 | 1d4bd90af0e4 tip | |
108 | % override commit message |
|
108 | % override commit message | |
109 | requesting all changes |
|
109 | requesting all changes | |
110 | adding changesets |
|
110 | adding changesets | |
111 | adding manifests |
|
111 | adding manifests | |
112 | adding file changes |
|
112 | adding file changes | |
113 | added 1 changesets with 2 changes to 2 files |
|
113 | added 1 changesets with 2 changes to 2 files | |
114 | updating to branch default |
|
114 | updating to branch default | |
115 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
115 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
116 | applying patch from stdin |
|
116 | applying patch from stdin | |
117 | summary: override |
|
117 | summary: override | |
118 | % plain diff in email, subject, message body |
|
118 | % plain diff in email, subject, message body | |
119 | requesting all changes |
|
119 | requesting all changes | |
120 | adding changesets |
|
120 | adding changesets | |
121 | adding manifests |
|
121 | adding manifests | |
122 | adding file changes |
|
122 | adding file changes | |
123 | added 1 changesets with 2 changes to 2 files |
|
123 | added 1 changesets with 2 changes to 2 files | |
124 | updating to branch default |
|
124 | updating to branch default | |
125 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
125 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
126 | applying ../msg.patch |
|
126 | applying ../msg.patch | |
127 | user: email patcher |
|
127 | user: email patcher | |
128 | summary: email patch |
|
128 | summary: email patch | |
129 | % plain diff in email, no subject, message body |
|
129 | % plain diff in email, no subject, message body | |
130 | requesting all changes |
|
130 | requesting all changes | |
131 | adding changesets |
|
131 | adding changesets | |
132 | adding manifests |
|
132 | adding manifests | |
133 | adding file changes |
|
133 | adding file changes | |
134 | added 1 changesets with 2 changes to 2 files |
|
134 | added 1 changesets with 2 changes to 2 files | |
135 | updating to branch default |
|
135 | updating to branch default | |
136 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
136 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
137 | applying patch from stdin |
|
137 | applying patch from stdin | |
138 | % plain diff in email, subject, no message body |
|
138 | % plain diff in email, subject, no message body | |
139 | requesting all changes |
|
139 | requesting all changes | |
140 | adding changesets |
|
140 | adding changesets | |
141 | adding manifests |
|
141 | adding manifests | |
142 | adding file changes |
|
142 | adding file changes | |
143 | added 1 changesets with 2 changes to 2 files |
|
143 | added 1 changesets with 2 changes to 2 files | |
144 | updating to branch default |
|
144 | updating to branch default | |
145 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
145 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
146 | applying patch from stdin |
|
146 | applying patch from stdin | |
147 | % plain diff in email, no subject, no message body, should fail |
|
147 | % plain diff in email, no subject, no message body, should fail | |
148 | requesting all changes |
|
148 | requesting all changes | |
149 | adding changesets |
|
149 | adding changesets | |
150 | adding manifests |
|
150 | adding manifests | |
151 | adding file changes |
|
151 | adding file changes | |
152 | added 1 changesets with 2 changes to 2 files |
|
152 | added 1 changesets with 2 changes to 2 files | |
153 | updating to branch default |
|
153 | updating to branch default | |
154 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
154 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
155 | applying patch from stdin |
|
155 | applying patch from stdin | |
156 | abort: empty commit message |
|
156 | abort: empty commit message | |
157 | % hg export in email, should use patch header |
|
157 | % hg export in email, should use patch header | |
158 | requesting all changes |
|
158 | requesting all changes | |
159 | adding changesets |
|
159 | adding changesets | |
160 | adding manifests |
|
160 | adding manifests | |
161 | adding file changes |
|
161 | adding file changes | |
162 | added 1 changesets with 2 changes to 2 files |
|
162 | added 1 changesets with 2 changes to 2 files | |
163 | updating to branch default |
|
163 | updating to branch default | |
164 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
164 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
165 | applying patch from stdin |
|
165 | applying patch from stdin | |
166 | summary: second change |
|
166 | summary: second change | |
167 | % plain diff in email, [PATCH] subject, message body with subject |
|
167 | % plain diff in email, [PATCH] subject, message body with subject | |
168 | requesting all changes |
|
168 | requesting all changes | |
169 | adding changesets |
|
169 | adding changesets | |
170 | adding manifests |
|
170 | adding manifests | |
171 | adding file changes |
|
171 | adding file changes | |
172 | added 1 changesets with 2 changes to 2 files |
|
172 | added 1 changesets with 2 changes to 2 files | |
173 | updating to branch default |
|
173 | updating to branch default | |
174 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
174 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
175 | applying patch from stdin |
|
175 | applying patch from stdin | |
176 | email patch |
|
176 | email patch | |
177 |
|
177 | |||
178 | next line |
|
178 | next line | |
179 | --- |
|
179 | --- | |
180 | % import patch1 patch2; rollback |
|
180 | % import patch1 patch2; rollback | |
181 | parent: 0 |
|
181 | parent: 0 | |
182 | applying ../patch1 |
|
182 | applying ../patch1 | |
183 | applying ../patch2 |
|
183 | applying ../patch2 | |
184 | applied 1d4bd90af0e4 |
|
184 | applied 1d4bd90af0e4 | |
185 | rolling back to revision 1 (undo commit) |
|
185 | rolling back to revision 1 (undo commit) | |
186 | parent: 1 |
|
186 | parent: 1 | |
187 | % hg import in a subdirectory |
|
187 | % hg import in a subdirectory | |
188 | requesting all changes |
|
188 | requesting all changes | |
189 | adding changesets |
|
189 | adding changesets | |
190 | adding manifests |
|
190 | adding manifests | |
191 | adding file changes |
|
191 | adding file changes | |
192 | added 1 changesets with 2 changes to 2 files |
|
192 | added 1 changesets with 2 changes to 2 files | |
193 | updating to branch default |
|
193 | updating to branch default | |
194 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
194 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
195 | applying ../../../tip.patch |
|
195 | applying ../../../tip.patch | |
196 | % message should be 'subdir change' |
|
196 | % message should be 'subdir change' | |
197 | summary: subdir change |
|
197 | summary: subdir change | |
198 | % committer should be 'someoneelse' |
|
198 | % committer should be 'someoneelse' | |
199 | user: someoneelse |
|
199 | user: someoneelse | |
200 | % should be empty |
|
200 | % should be empty | |
201 | % test fuzziness |
|
201 | % test fuzziness | |
202 | adding a |
|
202 | adding a | |
203 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
203 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
204 | created new head |
|
204 | created new head | |
205 | applying tip.patch |
|
205 | applying tip.patch | |
206 | patching file a |
|
206 | patching file a | |
207 | Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines). |
|
207 | Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines). | |
208 | reverting a |
|
208 | reverting a | |
209 | % test fuzziness with eol=auto |
|
209 | % test fuzziness with eol=auto | |
210 | applying tip.patch |
|
210 | applying tip.patch | |
211 | patching file a |
|
211 | patching file a | |
212 | Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines). |
|
212 | Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines). | |
213 | adding a |
|
213 | adding a | |
214 | adding b1 |
|
214 | adding b1 | |
215 | adding c1 |
|
215 | adding c1 | |
216 | adding d |
|
216 | adding d | |
217 | diff --git a/a b/a |
|
217 | diff --git a/a b/a | |
218 | --- a/a |
|
218 | --- a/a | |
219 | +++ b/a |
|
219 | +++ b/a | |
220 | @@ -0,0 +1,1 @@ |
|
220 | @@ -0,0 +1,1 @@ | |
221 | +a |
|
221 | +a | |
222 | diff --git a/b1 b/b2 |
|
222 | diff --git a/b1 b/b2 | |
223 | rename from b1 |
|
223 | rename from b1 | |
224 | rename to b2 |
|
224 | rename to b2 | |
225 | --- a/b1 |
|
225 | --- a/b1 | |
226 | +++ b/b2 |
|
226 | +++ b/b2 | |
227 | @@ -0,0 +1,1 @@ |
|
227 | @@ -0,0 +1,1 @@ | |
228 | +b |
|
228 | +b | |
229 | diff --git a/c1 b/c1 |
|
229 | diff --git a/c1 b/c1 | |
230 | --- a/c1 |
|
230 | --- a/c1 | |
231 | +++ b/c1 |
|
231 | +++ b/c1 | |
232 | @@ -0,0 +1,1 @@ |
|
232 | @@ -0,0 +1,1 @@ | |
233 | +c |
|
233 | +c | |
234 | diff --git a/c1 b/c2 |
|
234 | diff --git a/c1 b/c2 | |
235 | copy from c1 |
|
235 | copy from c1 | |
236 | copy to c2 |
|
236 | copy to c2 | |
237 | --- a/c1 |
|
237 | --- a/c1 | |
238 | +++ b/c2 |
|
238 | +++ b/c2 | |
239 | @@ -0,0 +1,1 @@ |
|
239 | @@ -0,0 +1,1 @@ | |
240 | +c |
|
240 | +c | |
241 | diff --git a/d b/d |
|
241 | diff --git a/d b/d | |
242 | --- a/d |
|
242 | --- a/d | |
243 | +++ b/d |
|
243 | +++ b/d | |
244 | @@ -1,1 +0,0 @@ |
|
244 | @@ -1,1 +0,0 @@ | |
245 | -d |
|
245 | -d | |
246 | 4 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
246 | 4 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
247 | applying empty.diff |
|
247 | applying empty.diff | |
248 | % a file |
|
248 | % a file | |
249 | a |
|
249 | a | |
250 | % b1 file |
|
250 | % b1 file | |
251 | % b2 file |
|
251 | % b2 file | |
252 | b |
|
252 | b | |
253 | % c1 file |
|
253 | % c1 file | |
254 | c |
|
254 | c | |
255 | % c2 file |
|
255 | % c2 file | |
256 | c |
|
256 | c | |
257 | % d file |
|
257 | % d file | |
258 | % test trailing binary removal |
|
258 | % test trailing binary removal | |
259 | adding a |
|
259 | adding a | |
260 | adding b |
|
260 | adding b | |
261 | R a |
|
261 | R a | |
262 | R b |
|
262 | R b | |
263 | diff --git a/a b/a |
|
263 | diff --git a/a b/a | |
264 | diff --git a/b b/b |
|
264 | diff --git a/b b/b | |
265 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
265 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
266 | applying remove.diff |
|
266 | applying remove.diff | |
267 | % test update+rename with common name (issue 927) |
|
267 | % test update+rename with common name (issue 927) | |
268 | adding a |
|
268 | adding a | |
269 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
269 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
270 | applying copy.diff |
|
270 | applying copy.diff | |
271 | % view a |
|
271 | % view a | |
272 | a |
|
272 | a | |
273 | % view a2 |
|
273 | % view a2 | |
274 | a |
|
274 | a | |
275 | % test -p0 |
|
275 | % test -p0 | |
276 | adding a |
|
276 | adding a | |
277 | applying patch from stdin |
|
277 | applying patch from stdin | |
278 | bb |
|
278 | bb | |
279 | % test paths outside repo root |
|
279 | % test paths outside repo root | |
280 | applying patch from stdin |
|
280 | applying patch from stdin | |
281 | abort: ../outside/foo not under root |
|
281 | abort: ../outside/foo not under root | |
282 | % test import with similarity (issue295) |
|
282 | % test import with similarity and git and strip (issue295 et al.) | |
283 | adding a |
|
283 | adding a | |
284 | applying ../rename.diff |
|
284 | applying ../rename.diff | |
285 | patching file a |
|
285 | patching file a | |
286 | patching file b |
|
286 | patching file b | |
287 | removing a |
|
287 | removing a | |
288 | adding b |
|
288 | adding b | |
289 | recording removal of a as rename to b (88% similar) |
|
289 | recording removal of a as rename to b (88% similar) | |
290 | A b |
|
290 | A b | |
291 | a |
|
291 | a | |
292 | R a |
|
292 | R a | |
293 | undeleting a |
|
293 | undeleting a | |
294 | forgetting b |
|
294 | forgetting b | |
295 | applying ../rename.diff |
|
295 | applying ../rename.diff | |
296 | patching file a |
|
296 | patching file a | |
297 | patching file b |
|
297 | patching file b | |
298 | removing a |
|
298 | removing a | |
299 | adding b |
|
299 | adding b | |
300 | A b |
|
300 | A b | |
301 | R a |
|
301 | R a | |
302 | % add empty file from the end of patch (issue 1495) |
|
302 | % add empty file from the end of patch (issue 1495) | |
303 | adding a |
|
303 | adding a | |
304 | applying a.patch |
|
304 | applying a.patch | |
305 | % create file when source is not /dev/null |
|
305 | % create file when source is not /dev/null | |
306 | applying ../create.patch |
|
306 | applying ../create.patch | |
307 | a |
|
307 | a | |
308 | applying ../create2.patch |
|
308 | applying ../create2.patch | |
309 | a |
|
309 | a | |
310 | % first line mistaken for email headers (issue 1859) |
|
310 | % first line mistaken for email headers (issue 1859) | |
311 | applying a.patch |
|
311 | applying a.patch | |
312 | changeset: 0:5a681217c0ad |
|
312 | changeset: 0:5a681217c0ad | |
313 | tag: tip |
|
313 | tag: tip | |
314 | user: test |
|
314 | user: test | |
315 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
315 | date: Thu Jan 01 00:00:00 1970 +0000 | |
316 | files: a |
|
316 | files: a | |
317 | description: |
|
317 | description: | |
318 | module: summary |
|
318 | module: summary | |
319 |
|
319 | |||
320 | description |
|
320 | description | |
321 |
|
321 | |||
322 |
|
322 | |||
323 | % --- in commit message |
|
323 | % --- in commit message | |
324 | applying a.patch |
|
324 | applying a.patch | |
325 | changeset: 0:f34d9187897d |
|
325 | changeset: 0:f34d9187897d | |
326 | tag: tip |
|
326 | tag: tip | |
327 | user: test |
|
327 | user: test | |
328 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
328 | date: Thu Jan 01 00:00:00 1970 +0000 | |
329 | files: a |
|
329 | files: a | |
330 | description: |
|
330 | description: | |
331 | module: summary |
|
331 | module: summary | |
332 |
|
332 | |||
333 |
|
333 | |||
334 | % tricky header splitting |
|
334 | % tricky header splitting | |
335 | applying ../trickyheaders.patch |
|
335 | applying ../trickyheaders.patch | |
336 | # HG changeset patch |
|
336 | # HG changeset patch | |
337 | # User User B |
|
337 | # User User B | |
338 | # Date 0 0 |
|
338 | # Date 0 0 | |
339 | # Node ID eb56ab91903632294ac504838508cb370c0901d2 |
|
339 | # Node ID eb56ab91903632294ac504838508cb370c0901d2 | |
340 | # Parent 0000000000000000000000000000000000000000 |
|
340 | # Parent 0000000000000000000000000000000000000000 | |
341 | from: tricky! |
|
341 | from: tricky! | |
342 |
|
342 | |||
343 | That is not a header. |
|
343 | That is not a header. | |
344 |
|
344 | |||
345 | diff --git a/foo b/foo |
|
345 | diff --git a/foo b/foo | |
346 | new file mode 100644 |
|
346 | new file mode 100644 | |
347 | --- /dev/null |
|
347 | --- /dev/null | |
348 | +++ b/foo |
|
348 | +++ b/foo | |
349 | @@ -0,0 +1,1 @@ |
|
349 | @@ -0,0 +1,1 @@ | |
350 | +foo |
|
350 | +foo | |
351 | % issue2102 |
|
351 | % issue2102 | |
352 | adding src/cmd/gc/mksys.bash |
|
352 | adding src/cmd/gc/mksys.bash | |
353 | applying patch from stdin |
|
353 | applying patch from stdin | |
354 | parent: 1:d59915696727 tip |
|
354 | parent: 1:d59915696727 tip | |
355 | help management of empty pkg and lib directories in perforce |
|
355 | help management of empty pkg and lib directories in perforce | |
356 | branch: default |
|
356 | branch: default | |
357 | commit: (clean) |
|
357 | commit: (clean) | |
358 | update: (current) |
|
358 | update: (current) | |
359 | diff --git a/lib/place-holder b/lib/place-holder |
|
359 | diff --git a/lib/place-holder b/lib/place-holder | |
360 | new file mode 100644 |
|
360 | new file mode 100644 | |
361 | --- /dev/null |
|
361 | --- /dev/null | |
362 | +++ b/lib/place-holder |
|
362 | +++ b/lib/place-holder | |
363 | @@ -0,0 +1,2 @@ |
|
363 | @@ -0,0 +1,2 @@ | |
364 | +perforce does not maintain empty directories. |
|
364 | +perforce does not maintain empty directories. | |
365 | +this file helps. |
|
365 | +this file helps. | |
366 | diff --git a/pkg/place-holder b/pkg/place-holder |
|
366 | diff --git a/pkg/place-holder b/pkg/place-holder | |
367 | new file mode 100644 |
|
367 | new file mode 100644 | |
368 | --- /dev/null |
|
368 | --- /dev/null | |
369 | +++ b/pkg/place-holder |
|
369 | +++ b/pkg/place-holder | |
370 | @@ -0,0 +1,2 @@ |
|
370 | @@ -0,0 +1,2 @@ | |
371 | +perforce does not maintain empty directories. |
|
371 | +perforce does not maintain empty directories. | |
372 | +this file helps. |
|
372 | +this file helps. | |
373 | diff --git a/src/cmd/gc/mksys.bash b/src/cmd/gc/mksys.bash |
|
373 | diff --git a/src/cmd/gc/mksys.bash b/src/cmd/gc/mksys.bash | |
374 | old mode 100644 |
|
374 | old mode 100644 | |
375 | new mode 100755 |
|
375 | new mode 100755 | |
376 | % diff lines looking like headers |
|
376 | % diff lines looking like headers | |
377 | adding a |
|
377 | adding a | |
378 | adding b |
|
378 | adding b | |
379 | adding c |
|
379 | adding c | |
380 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
380 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
381 | applying patch from stdin |
|
381 | applying patch from stdin |
General Comments 0
You need to be logged in to leave comments.
Login now