comparison hgext/patchbomb.py @ 8826:2aff285b902f

patchbomb: do not assume the presence of angle brackets around msg-id RFC 5322 states: "Semantically, the angle bracket characters are not part of the msg-id; the msg-id is what is contained between the two angle bracket characters." Hence it should be correct to pass a message Id with no angle brackets to --in-reply-to. Adding them if missing.
author Cédric Duval <cedricduval@free.fr>
date Wed, 17 Jun 2009 20:54:26 +0200
parents 0289f384e1e5
children 87c30fb7e8df
comparison
equal deleted inserted replaced
8825:ec33cf8610a9 8826:2aff285b902f
395 for a in bcc if a.strip()] 395 for a in bcc if a.strip()]
396 396
397 ui.write('\n') 397 ui.write('\n')
398 398
399 parent = opts.get('in_reply_to') or None 399 parent = opts.get('in_reply_to') or None
400 # angle brackets may be omitted, they're not semantically part of the msg-id
401 if parent is not None:
402 if not parent.startswith('<'):
403 parent = '<' + parent
404 if not parent.endswith('>'):
405 parent += '>'
406
400 first = True 407 first = True
401 408
402 sender_addr = email.Utils.parseaddr(sender)[1] 409 sender_addr = email.Utils.parseaddr(sender)[1]
403 sender = mail.addressencode(ui, sender, _charsets, opts.get('test')) 410 sender = mail.addressencode(ui, sender, _charsets, opts.get('test'))
404 sendmail = None 411 sendmail = None