mercurial/patch.py
changeset 37456 19becdf565ef
parent 37120 a8a902d7176e
child 37458 00e4bd97b095
equal deleted inserted replaced
37455:9ecb7c471cfb 37456:19becdf565ef
   226 
   226 
   227         subject = msg['Subject'] and mail.headdecode(msg['Subject'])
   227         subject = msg['Subject'] and mail.headdecode(msg['Subject'])
   228         data['user'] = msg['From'] and mail.headdecode(msg['From'])
   228         data['user'] = msg['From'] and mail.headdecode(msg['From'])
   229         if not subject and not data['user']:
   229         if not subject and not data['user']:
   230             # Not an email, restore parsed headers if any
   230             # Not an email, restore parsed headers if any
   231             subject = '\n'.join(': '.join(h) for h in msg.items()) + '\n'
   231             subject = '\n'.join(': '.join(map(encoding.strtolocal, h))
       
   232                                 for h in msg.items()) + '\n'
   232 
   233 
   233         # should try to parse msg['Date']
   234         # should try to parse msg['Date']
   234         parents = []
   235         parents = []
   235 
   236 
   236         if subject:
   237         if subject: