diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py --- a/hgext/patchbomb.py +++ b/hgext/patchbomb.py @@ -496,8 +496,6 @@ def patchbomb(ui, repo, *revs, **opts): 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 @@ def patchbomb(ui, repo, *revs, **opts): 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) diff --git a/tests/test-patchbomb.t b/tests/test-patchbomb.t --- a/tests/test-patchbomb.t +++ b/tests/test-patchbomb.t @@ -1663,8 +1663,8 @@ no intro message in non-interactive mode 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: + References: User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:01 +0000 From: quux