Show More
@@ -63,6 +63,10 b' def extract(ui, fileobj):' | |||
|
63 | 63 | |
|
64 | 64 | subject = msg['Subject'] |
|
65 | 65 | user = msg['From'] |
|
66 | if not subject and not user: | |
|
67 | # Not an email, restore parsed headers if any | |
|
68 | subject = '\n'.join(': '.join(h) for h in msg.items()) + '\n' | |
|
69 | ||
|
66 | 70 | gitsendmail = 'git-send-email' in msg.get('X-Mailer', '') |
|
67 | 71 | # should try to parse msg['Date'] |
|
68 | 72 | date = None |
@@ -332,3 +332,23 b' new file mode 100644' | |||
|
332 | 332 | EOF |
|
333 | 333 | hg import --no-commit a.patch |
|
334 | 334 | cd .. |
|
335 | ||
|
336 | echo % 'first line mistaken for email headers (issue 1859)' | |
|
337 | hg init emailconfusion | |
|
338 | cd emailconfusion | |
|
339 | cat > a.patch <<EOF | |
|
340 | module: summary | |
|
341 | ||
|
342 | description | |
|
343 | ||
|
344 | ||
|
345 | diff -r 000000000000 -r 9b4c1e343b55 test.txt | |
|
346 | --- /dev/null | |
|
347 | +++ b/a | |
|
348 | @@ -0,0 +1,1 @@ | |
|
349 | +a | |
|
350 | EOF | |
|
351 | hg import -d '0 0' a.patch | |
|
352 | hg parents -v | |
|
353 | cd .. | |
|
354 |
@@ -292,3 +292,16 b' R a' | |||
|
292 | 292 | % add empty file from the end of patch (issue 1495) |
|
293 | 293 | adding a |
|
294 | 294 | applying a.patch |
|
295 | % first line mistaken for email headers (issue 1859) | |
|
296 | applying a.patch | |
|
297 | changeset: 0:5a681217c0ad | |
|
298 | tag: tip | |
|
299 | user: test | |
|
300 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
301 | files: a | |
|
302 | description: | |
|
303 | module: summary | |
|
304 | ||
|
305 | description | |
|
306 | ||
|
307 |
General Comments 0
You need to be logged in to leave comments.
Login now