# HG changeset patch # User Christian Ebert # Date 1154117852 -7200 # Node ID 10e95059ffd79df8f4c21584390b04ec1c3374f8 # Parent d1fa79e7b07e0b812d009fcdf78e0dbe9758aa07 patchbomb: fix generation of message-id when sending attachments node was set to bin(node) before message-id was created diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py --- a/hgext/patchbomb.py +++ b/hgext/patchbomb.py @@ -135,17 +135,17 @@ def patchbomb(ui, repo, *revs, **opts): msg = email.MIMEMultipart.MIMEMultipart() if body: msg.attach(email.MIMEText.MIMEText(body, 'plain')) p = email.MIMEText.MIMEText('\n'.join(patch), 'x-patch') - node = bin(node) + binnode = bin(node) # if node is mq patch, it will have patch file name as tag - patchname = [t for t in repo.nodetags(node) + patchname = [t for t in repo.nodetags(binnode) if t.endswith('.patch') or t.endswith('.diff')] if patchname: patchname = patchname[0] elif total > 1: patchname = commands.make_filename(repo, '%b-%n.patch', - node, idx, total) + binnode, idx, total) else: - patchname = commands.make_filename(repo, '%b.patch', node) + patchname = commands.make_filename(repo, '%b.patch', binnode) p['Content-Disposition'] = 'inline; filename=' + patchname msg.attach(p) else: