changeset 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 ec33cf8610a9
children 34d611dbed56
files hgext/patchbomb.py
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/patchbomb.py	Thu Jun 18 01:21:26 2009 +0100
+++ b/hgext/patchbomb.py	Wed Jun 17 20:54:26 2009 +0200
@@ -397,6 +397,13 @@
     ui.write('\n')
 
     parent = opts.get('in_reply_to') or None
+    # angle brackets may be omitted, they're not semantically part of the msg-id
+    if parent is not None:
+        if not parent.startswith('<'):
+            parent = '<' + parent
+        if not parent.endswith('>'):
+            parent += '>'
+
     first = True
 
     sender_addr = email.Utils.parseaddr(sender)[1]