Commits

Thomas Arendsen Hein committed d38d90a

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
...

Comments (0)

Files changed (2)

hgext/patchbomb.py

         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
         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)

tests/test-patchbomb.t

   Subject: [PATCH 2 of 2] b
   X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
   Message-Id: <97d72e5f12c7e84f8506.61@*> (glob)
-  In-Reply-To: <8580ff50825a50c8f716.60@*> (glob)
-  References: <8580ff50825a50c8f716.60@*> (glob)
+  In-Reply-To: <baz>
+  References: <baz>
   User-Agent: Mercurial-patchbomb/* (glob)
   Date: Thu, 01 Jan 1970 00:01:01 +0000
   From: quux