Show More
@@ -11,6 +11,12 b'' | |||
|
11 | 11 | $ hg --cwd a ci -u someone -d '1 0' -m'second change' |
|
12 | 12 | |
|
13 | 13 | |
|
14 | generate patches for the test | |
|
15 | ||
|
16 | $ hg --cwd a export tip > exported-tip.patch | |
|
17 | $ hg --cwd a diff -r0:1 > diffed-tip.patch | |
|
18 | ||
|
19 | ||
|
14 | 20 | import exported patch |
|
15 | 21 | |
|
16 | 22 | $ hg clone -r0 a b |
@@ -20,19 +26,18 b' import exported patch' | |||
|
20 | 26 | added 1 changesets with 2 changes to 2 files |
|
21 | 27 | updating to branch default |
|
22 | 28 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
23 |
$ hg --cwd |
|
|
24 | $ hg --cwd b import ../tip.patch | |
|
25 | applying ../tip.patch | |
|
29 | $ hg --cwd b import ../exported-tip.patch | |
|
30 | applying ../exported-tip.patch | |
|
31 | ||
|
32 | message and committer should be same | |
|
26 | 33 | |
|
27 | message should be same | |
|
28 | ||
|
29 | $ hg --cwd b tip | grep 'second change' | |
|
34 | $ hg --cwd b tip | |
|
35 | changeset: 1:1d4bd90af0e4 | |
|
36 | tag: tip | |
|
37 | user: someone | |
|
38 | date: Thu Jan 01 00:00:01 1970 +0000 | |
|
30 | 39 | summary: second change |
|
31 | 40 | |
|
32 | committer should be same | |
|
33 | ||
|
34 | $ hg --cwd b tip | grep someone | |
|
35 | user: someone | |
|
36 | 41 | $ rm -r b |
|
37 | 42 | |
|
38 | 43 | |
@@ -50,9 +55,8 b' import exported patch with external patc' | |||
|
50 | 55 | added 1 changesets with 2 changes to 2 files |
|
51 | 56 | updating to branch default |
|
52 | 57 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
53 | $ hg --cwd a export tip > tip.patch | |
|
54 | $ hg --config ui.patch='python ../dummypatch.py' --cwd b import ../tip.patch | |
|
55 | applying ../tip.patch | |
|
58 | $ hg --config ui.patch='python ../dummypatch.py' --cwd b import ../exported-tip.patch | |
|
59 | applying ../exported-tip.patch | |
|
56 | 60 | $ cat b/a |
|
57 | 61 | line2 |
|
58 | 62 | $ rm -r b |
@@ -67,9 +71,8 b' import of plain diff should fail without' | |||
|
67 | 71 | added 1 changesets with 2 changes to 2 files |
|
68 | 72 | updating to branch default |
|
69 | 73 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
70 |
$ hg --cwd |
|
|
71 | $ hg --cwd b import ../tip.patch | |
|
72 | applying ../tip.patch | |
|
74 | $ hg --cwd b import ../diffed-tip.patch | |
|
75 | applying ../diffed-tip.patch | |
|
73 | 76 | abort: empty commit message |
|
74 | 77 | [255] |
|
75 | 78 | $ rm -r b |
@@ -84,9 +87,8 b' import of plain diff should be ok with m' | |||
|
84 | 87 | added 1 changesets with 2 changes to 2 files |
|
85 | 88 | updating to branch default |
|
86 | 89 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
87 |
$ hg --cwd |
|
|
88 | $ hg --cwd b import -mpatch ../tip.patch | |
|
89 | applying ../tip.patch | |
|
90 | $ hg --cwd b import -mpatch ../diffed-tip.patch | |
|
91 | applying ../diffed-tip.patch | |
|
90 | 92 | $ rm -r b |
|
91 | 93 | |
|
92 | 94 | |
@@ -99,9 +101,8 b' import of plain diff with specific date ' | |||
|
99 | 101 | added 1 changesets with 2 changes to 2 files |
|
100 | 102 | updating to branch default |
|
101 | 103 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
102 | $ hg --cwd a diff -r0:1 > tip.patch | |
|
103 | $ hg --cwd b import -mpatch -d '1 0' -u 'user@nowhere.net' ../tip.patch | |
|
104 | applying ../tip.patch | |
|
104 | $ hg --cwd b import -mpatch -d '1 0' -u 'user@nowhere.net' ../diffed-tip.patch | |
|
105 | applying ../diffed-tip.patch | |
|
105 | 106 | $ hg -R b tip -pv |
|
106 | 107 | changeset: 1:ca68f19f3a40 |
|
107 | 108 | tag: tip |
@@ -131,9 +132,8 b' import of plain diff should be ok with -' | |||
|
131 | 132 | added 1 changesets with 2 changes to 2 files |
|
132 | 133 | updating to branch default |
|
133 | 134 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
134 |
$ hg --cwd |
|
|
135 | $ hg --cwd b import --no-commit ../tip.patch | |
|
136 | applying ../tip.patch | |
|
135 | $ hg --cwd b import --no-commit ../diffed-tip.patch | |
|
136 | applying ../diffed-tip.patch | |
|
137 | 137 | $ hg --cwd b diff --nodates |
|
138 | 138 | diff -r 80971e65b431 a |
|
139 | 139 | --- a/a |
@@ -153,8 +153,7 b' import of malformed plain diff should fa' | |||
|
153 | 153 | added 1 changesets with 2 changes to 2 files |
|
154 | 154 | updating to branch default |
|
155 | 155 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
156 | $ hg --cwd a diff -r0:1 > tip.patch | |
|
157 | $ sed 's/1,1/foo/' < tip.patch > broken.patch | |
|
156 | $ sed 's/1,1/foo/' < diffed-tip.patch > broken.patch | |
|
158 | 157 |
$ |
|
159 | 158 | applying ../broken.patch |
|
160 | 159 | abort: bad hunk #1 |
@@ -174,10 +173,9 b' used to hide a bug.' | |||
|
174 | 173 | added 1 changesets with 2 changes to 2 files |
|
175 | 174 | updating to branch default |
|
176 | 175 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
177 | $ hg --cwd a export tip > dir/tip.patch | |
|
178 | 176 | $ cd dir |
|
179 | $ hg -R b import tip.patch | |
|
180 | applying tip.patch | |
|
177 | $ hg -R b import ../exported-tip.patch | |
|
178 | applying ../exported-tip.patch | |
|
181 | 179 | $ cd .. |
|
182 | 180 | $ rm -r dir |
|
183 | 181 | |
@@ -191,7 +189,7 b' import from stdin' | |||
|
191 | 189 | added 1 changesets with 2 changes to 2 files |
|
192 | 190 | updating to branch default |
|
193 | 191 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
194 | $ hg --cwd a export tip | hg --cwd b import - | |
|
192 | $ hg --cwd b import - < exported-tip.patch | |
|
195 | 193 | applying patch from stdin |
|
196 | 194 | $ rm -r b |
|
197 | 195 | |
@@ -218,7 +216,7 b' override commit message' | |||
|
218 | 216 | added 1 changesets with 2 changes to 2 files |
|
219 | 217 | updating to branch default |
|
220 | 218 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
221 |
$ |
|
|
219 | $ hg --cwd b import -m 'override' - < exported-tip.patch | |
|
222 | 220 | applying patch from stdin |
|
223 | 221 | $ hg --cwd b tip | grep override |
|
224 | 222 | summary: override |
@@ -227,7 +225,8 b' override commit message' | |||
|
227 | 225 | $ cat > mkmsg.py <<EOF |
|
228 | 226 | > import email.Message, sys |
|
229 | 227 | > msg = email.Message.Message() |
|
230 | > msg.set_payload('email commit message\n' + open('tip.patch', 'rb').read()) | |
|
228 | > patch = open(sys.argv[1], 'rb').read() | |
|
229 | > msg.set_payload('email commit message\n' + patch) | |
|
231 | 230 | > msg['Subject'] = 'email patch' |
|
232 | 231 | > msg['From'] = 'email patcher' |
|
233 | 232 | > sys.stdout.write(msg.as_string()) |
@@ -243,8 +242,7 b' plain diff in email, subject, message bo' | |||
|
243 | 242 | added 1 changesets with 2 changes to 2 files |
|
244 | 243 | updating to branch default |
|
245 | 244 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
246 | $ hg --cwd a diff -r0:1 > tip.patch | |
|
247 | $ python mkmsg.py > msg.patch | |
|
245 | $ python mkmsg.py diffed-tip.patch > msg.patch | |
|
248 | 246 | $ hg --cwd b import ../msg.patch |
|
249 | 247 | applying ../msg.patch |
|
250 | 248 | $ hg --cwd b tip | grep email |
@@ -306,8 +304,7 b' hg export in email, should use patch hea' | |||
|
306 | 304 | added 1 changesets with 2 changes to 2 files |
|
307 | 305 | updating to branch default |
|
308 | 306 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
309 | $ hg --cwd a export tip > tip.patch | |
|
310 | $ python mkmsg.py | hg --cwd b import - | |
|
307 | $ python mkmsg.py exported-tip.patch | hg --cwd b import - | |
|
311 | 308 | applying patch from stdin |
|
312 | 309 | $ hg --cwd b tip | grep second |
|
313 | 310 | summary: second change |
@@ -320,7 +317,8 b" The '---' tests the gitsendmail handling" | |||
|
320 | 317 | $ cat > mkmsg2.py <<EOF |
|
321 | 318 | > import email.Message, sys |
|
322 | 319 | > msg = email.Message.Message() |
|
323 | > msg.set_payload('email patch\n\nnext line\n---\n' + open('tip.patch').read()) | |
|
320 | > patch = open(sys.argv[1], 'rb').read() | |
|
321 | > msg.set_payload('email patch\n\nnext line\n---\n' + patch) | |
|
324 | 322 | > msg['Subject'] = '[PATCH] email patch' |
|
325 | 323 | > msg['From'] = 'email patcher' |
|
326 | 324 | > sys.stdout.write(msg.as_string()) |
@@ -336,8 +334,7 b' plain diff in email, [PATCH] subject, me' | |||
|
336 | 334 | added 1 changesets with 2 changes to 2 files |
|
337 | 335 | updating to branch default |
|
338 | 336 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
339 | $ hg --cwd a diff -r0:1 > tip.patch | |
|
340 | $ python mkmsg2.py | hg --cwd b import - | |
|
337 | $ python mkmsg2.py diffed-tip.patch | hg --cwd b import - | |
|
341 | 338 | applying patch from stdin |
|
342 | 339 | $ hg --cwd b tip --template '{desc}\n' |
|
343 | 340 | email patch |
@@ -386,22 +383,23 b' hg import in a subdirectory' | |||
|
386 | 383 | updating to branch default |
|
387 | 384 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
388 | 385 | $ hg --cwd a export tip > tmp |
|
389 | $ sed -e 's/d1\/d2\///' < tmp > tip.patch | |
|
386 | $ sed -e 's/d1\/d2\///' < tmp > subdir-tip.patch | |
|
390 | 387 | $ dir=`pwd` |
|
391 | 388 | $ cd b/d1/d2 2>&1 > /dev/null |
|
392 | $ hg import ../../../tip.patch | |
|
393 | applying ../../../tip.patch | |
|
389 | $ hg import ../../../subdir-tip.patch | |
|
390 | applying ../../../subdir-tip.patch | |
|
394 | 391 | $ cd "$dir" |
|
395 | 392 | |
|
396 | 393 | message should be 'subdir change' |
|
394 | committer should be 'someoneelse' | |
|
397 | 395 | |
|
398 |
$ hg --cwd b tip |
|
|
396 | $ hg --cwd b tip | |
|
397 | changeset: 1:3577f5aea227 | |
|
398 | tag: tip | |
|
399 | user: someoneelse | |
|
400 | date: Thu Jan 01 00:00:01 1970 +0000 | |
|
399 | 401 | summary: subdir change |
|
400 | 402 | |
|
401 | committer should be 'someoneelse' | |
|
402 | ||
|
403 | $ hg --cwd b tip | grep someoneelse | |
|
404 | user: someoneelse | |
|
405 | 403 | |
|
406 | 404 | should be empty |
|
407 | 405 | |
@@ -422,7 +420,7 b' Test fuzziness (ambiguous patch location' | |||
|
422 | 420 | $ echo line0 >> a |
|
423 | 421 | $ echo line3 >> a |
|
424 | 422 | $ hg ci -m change a |
|
425 | $ hg export tip > tip.patch | |
|
423 | $ hg export tip > fuzzy-tip.patch | |
|
426 | 424 | $ hg up -C 0 |
|
427 | 425 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
428 | 426 | $ echo line1 > a |
@@ -431,8 +429,8 b' Test fuzziness (ambiguous patch location' | |||
|
431 | 429 | $ echo line0 >> a |
|
432 | 430 | $ hg ci -m brancha |
|
433 | 431 | created new head |
|
434 | $ hg import --no-commit -v tip.patch | |
|
435 | applying tip.patch | |
|
432 | $ hg import --no-commit -v fuzzy-tip.patch | |
|
433 | applying fuzzy-tip.patch | |
|
436 | 434 | patching file a |
|
437 | 435 | Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines). |
|
438 | 436 | $ hg revert -a |
@@ -447,8 +445,8 b' import with --no-commit should have writ' | |||
|
447 | 445 | |
|
448 | 446 | test fuzziness with eol=auto |
|
449 | 447 | |
|
450 | $ hg --config patch.eol=auto import --no-commit -v tip.patch | |
|
451 | applying tip.patch | |
|
448 | $ hg --config patch.eol=auto import --no-commit -v fuzzy-tip.patch | |
|
449 | applying fuzzy-tip.patch | |
|
452 | 450 | patching file a |
|
453 | 451 | Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines). |
|
454 | 452 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now