diff -r c100dbd593e2 -r 8286f551b7ee mercurial/patch.py --- a/mercurial/patch.py Wed Mar 02 22:39:03 2016 +0000 +++ b/mercurial/patch.py Thu Mar 03 18:34:19 2016 +0100 @@ -31,6 +31,7 @@ diffhelpers, encoding, error, + mail, mdiff, pathutil, scmutil, @@ -210,8 +211,8 @@ try: msg = email.Parser.Parser().parse(fileobj) - subject = msg['Subject'] - data['user'] = msg['From'] + subject = msg['Subject'] and mail.headdecode(msg['Subject']) + data['user'] = msg['From'] and mail.headdecode(msg['From']) if not subject and not data['user']: # Not an email, restore parsed headers if any subject = '\n'.join(': '.join(h) for h in msg.items()) + '\n'