Mercurial > public > mercurial-scm > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
17858:acd4577a568d | 17859:d38d90ad5bbf |
---|---|
494 if not parent.startswith('<'): | 494 if not parent.startswith('<'): |
495 parent = '<' + parent | 495 parent = '<' + parent |
496 if not parent.endswith('>'): | 496 if not parent.endswith('>'): |
497 parent += '>' | 497 parent += '>' |
498 | 498 |
499 first = True | |
500 | |
501 sender_addr = email.Utils.parseaddr(sender)[1] | 499 sender_addr = email.Utils.parseaddr(sender)[1] |
502 sender = mail.addressencode(ui, sender, _charsets, opts.get('test')) | 500 sender = mail.addressencode(ui, sender, _charsets, opts.get('test')) |
503 sendmail = None | 501 sendmail = None |
504 for i, (m, subj, ds) in enumerate(msgs): | 502 for i, (m, subj, ds) in enumerate(msgs): |
505 try: | 503 try: |
507 except TypeError: | 505 except TypeError: |
508 m['Message-Id'] = genmsgid('patchbomb') | 506 m['Message-Id'] = genmsgid('patchbomb') |
509 if parent: | 507 if parent: |
510 m['In-Reply-To'] = parent | 508 m['In-Reply-To'] = parent |
511 m['References'] = parent | 509 m['References'] = parent |
512 if first: | 510 if not parent or 'X-Mercurial-Node' not in m: |
513 parent = m['Message-Id'] | 511 parent = m['Message-Id'] |
514 first = False | |
515 | 512 |
516 m['User-Agent'] = 'Mercurial-patchbomb/%s' % util.version() | 513 m['User-Agent'] = 'Mercurial-patchbomb/%s' % util.version() |
517 m['Date'] = email.Utils.formatdate(start_time[0], localtime=True) | 514 m['Date'] = email.Utils.formatdate(start_time[0], localtime=True) |
518 | 515 |
519 start_time = (start_time[0] + 1, start_time[1]) | 516 start_time = (start_time[0] + 1, start_time[1]) |