mercurial/patch.py
changeset 9591 012f1244cd4c
parent 9467 4c041f1ee1b4
parent 9573 b8352a3617f3
child 9598 a981ddb16b80
--- 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