# HG changeset patch # User Patrick Mezard # Date 1191874823 -7200 # Node ID 9b469bdb1ce1015bdebdf8fe9bc31412c6185e9b # Parent b8872655f951e9f7c2c2cc7fa47a9047e2d8c645 patch: fix git sendmail handling without proper mail headers diff -r b8872655f951 -r 9b469bdb1ce1 mercurial/patch.py --- a/mercurial/patch.py Mon Oct 08 11:18:34 2007 +0800 +++ b/mercurial/patch.py Mon Oct 08 22:20:23 2007 +0200 @@ -59,6 +59,7 @@ subject = msg['Subject'] user = msg['From'] + gitsendmail = 'git-send-email' in msg.get('X-Mailer', '') # should try to parse msg['Date'] date = None nodeid = None @@ -111,7 +112,7 @@ nodeid = line[10:] elif line.startswith("# Parent "): parents.append(line[10:]) - elif line == '---' and 'git-send-email' in msg['X-Mailer']: + elif line == '---' and gitsendmail: ignoretext = True if not line.startswith('# ') and not ignoretext: cfp.write(line) diff -r b8872655f951 -r 9b469bdb1ce1 tests/test-import --- a/tests/test-import Mon Oct 08 11:18:34 2007 +0800 +++ b/tests/test-import Mon Oct 08 22:20:23 2007 +0200 @@ -94,10 +94,11 @@ rm -r b # subject: duplicate detection, removal of [PATCH] +# The '---' tests the gitsendmail handling without proper mail headers cat > mkmsg2.py <