diff -r 4333b9744419 -r 012f1244cd4c mercurial/patch.py --- a/mercurial/patch.py Wed Oct 07 22:50:20 2009 +0200 +++ b/mercurial/patch.py Fri Oct 09 00:29:39 2009 +0200 @@ -63,6 +63,10 @@ subject = msg['Subject'] user = msg['From'] + if not subject and not user: + # Not an email, restore parsed headers if any + subject = '\n'.join(': '.join(h) for h in msg.items()) + '\n' + gitsendmail = 'git-send-email' in msg.get('X-Mailer', '') # should try to parse msg['Date'] date = None