##// END OF EJS Templates
import: read X-Mercurial-Node email header to determine nodeid...
Denis Laxalde -
r43367:27c4f93d default
parent child Browse files
Show More
@@ -256,6 +256,11 b' def _extract(ui, fileobj, tmpname, tmpfp'
256 # should try to parse msg['Date']
256 # should try to parse msg['Date']
257 parents = []
257 parents = []
258
258
259 nodeid = msg[r'X-Mercurial-Node']
260 if nodeid:
261 data[b'nodeid'] = nodeid = mail.headdecode(nodeid)
262 ui.debug(b'Node ID: %s\n' % nodeid)
263
259 if subject:
264 if subject:
260 if subject.startswith(b'[PATCH'):
265 if subject.startswith(b'[PATCH'):
261 pend = subject.find(b']')
266 pend = subject.find(b']')
@@ -237,7 +237,6 b' import of malformed plain diff should fa'
237 [255]
237 [255]
238 $ rm -r b
238 $ rm -r b
239
239
240
241 hg -R repo import
240 hg -R repo import
242 put the clone in a subdir - having a directory named "a"
241 put the clone in a subdir - having a directory named "a"
243 used to hide a bug.
242 used to hide a bug.
@@ -396,6 +395,48 b' hg export in email, should use patch hea'
396 summary: second change
395 summary: second change
397 $ rm -r b
396 $ rm -r b
398
397
398 hg email --plain, should read X-Mercurial-Node header
399
400 $ cat >> a/.hg/hgrc << EOF
401 > [extensions]
402 > patchbomb =
403 > [email]
404 > from = foo
405 > cc = foo
406 > to = bar
407 > EOF
408 $ hg --cwd a email -m ../tip-plain.mbox --plain --date '1970-1-1 0:1' tip
409 this patch series consists of 1 patches.
410
411
412 sending [PATCH] second change ...
413
414 $ hg clone -r0 a b -q
415 $ hg --cwd b import --debug ../tip-plain.mbox
416 applying ../tip-plain.mbox
417 Node ID: 1d4bd90af0e43687763d158dfa83ff2a4b6c0c32
418 Subject: second change
419 From: foo
420 Content-Type: text/plain
421 found patch at byte 0
422 message:
423 second change
424 patching file a
425 committing files:
426 a
427 committing manifest
428 committing changelog
429 created de620f6fe949
430 updating the branch cache
431 $ hg --cwd b tip
432 changeset: 1:de620f6fe949
433 tag: tip
434 user: foo
435 date: Thu Jan 01 00:00:00 1970 +0000
436 summary: second change
437
438 $ rm -r b
439
399
440
400 subject: duplicate detection, removal of [PATCH]
441 subject: duplicate detection, removal of [PATCH]
401 The '---' tests the gitsendmail handling without proper mail headers
442 The '---' tests the gitsendmail handling without proper mail headers
General Comments 0
You need to be logged in to leave comments. Login now