diff hgext/patchbomb.py @ 17859:d38d90ad5bbf stable

patchbomb: respect --in-reply-to for all mails if no intro message is sent Before this change, the thread hierarchy looked like this: PARENT PATCH1/x PATCH2/x PATCH3/x ... Now it is: PARENT PATCH1/x PATCH2/x PATCH3/x ... With an introductory message the behaviour is unchanged: PARENT INTRO PATCH1/x PATCH2/x PATCH3/x ...
author Thomas Arendsen Hein <thomas@intevation.de>
date Wed, 24 Oct 2012 09:53:10 +0200
parents 8308f6284640
children 9f6044119166
line wrap: on
line diff
--- a/hgext/patchbomb.py	Tue Oct 23 17:06:31 2012 +0900
+++ b/hgext/patchbomb.py	Wed Oct 24 09:53:10 2012 +0200
@@ -496,8 +496,6 @@
         if not parent.endswith('>'):
             parent += '>'
 
-    first = True
-
     sender_addr = email.Utils.parseaddr(sender)[1]
     sender = mail.addressencode(ui, sender, _charsets, opts.get('test'))
     sendmail = None
@@ -509,9 +507,8 @@
         if parent:
             m['In-Reply-To'] = parent
             m['References'] = parent
-        if first:
+        if not parent or 'X-Mercurial-Node' not in m:
             parent = m['Message-Id']
-            first = False
 
         m['User-Agent'] = 'Mercurial-patchbomb/%s' % util.version()
         m['Date'] = email.Utils.formatdate(start_time[0], localtime=True)