# HG changeset patch # User Cédric Duval # Date 1242689858 -7200 # Node ID 252232621165917755727729c7f0b9a1f1263668 # Parent b9308af35ba2d19900780da58b0aff2cfad563c0 patchbomb: with --in-reply-to, still thread message under first in series When specifying --in-reply-to for a message M, have [M] [0/2] [1/2] [2/2] instead of [M] [0/2] [1/2] [2/2] which is more consistent with the way messages are being threaded when --in-reply-to is not used. diff -r b9308af35ba2 -r 252232621165 hgext/patchbomb.py --- a/hgext/patchbomb.py Tue May 19 01:17:54 2009 +0200 +++ b/hgext/patchbomb.py Tue May 19 01:37:38 2009 +0200 @@ -397,6 +397,7 @@ ui.write('\n') parent = opts.get('in_reply_to') or None + first = True sender_addr = email.Utils.parseaddr(sender)[1] sender = mail.addressencode(ui, sender, _charsets, opts.get('test')) @@ -409,8 +410,10 @@ if parent: m['In-Reply-To'] = parent m['References'] = parent - else: + if first: parent = m['Message-Id'] + first = False + m['User-Agent'] = 'Mercurial-patchbomb/%s' % util.version() m['Date'] = util.datestr(start_time, "%a, %d %b %Y %H:%M:%S %1%2") diff -r b9308af35ba2 -r 252232621165 tests/test-patchbomb --- a/tests/test-patchbomb Tue May 19 01:17:54 2009 +0200 +++ b/tests/test-patchbomb Tue May 19 01:37:38 2009 +0200 @@ -148,3 +148,6 @@ echo "% test inreplyto" hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \ -r tip | fixheaders + +hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \ + -r 0:1 | fixheaders diff -r b9308af35ba2 -r 252232621165 tests/test-patchbomb.out --- a/tests/test-patchbomb.out Tue May 19 01:17:54 2009 +0200 +++ b/tests/test-patchbomb.out Tue May 19 01:37:38 2009 +0200 @@ -1177,3 +1177,80 @@ +ff2c9fa2018b15fa74b33363bda9527323e2a99f two +ff2c9fa2018b15fa74b33363bda9527323e2a99f two.diff +This patch series consists of 2 patches. + + +Write the introductory message for the patch series. + + +Displaying [PATCH 0 of 2] None ... +Content-Type: text/plain; charset="us-ascii" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [PATCH 0 of 2] None +Message-Id: