changeset 2722:10e95059ffd7

patchbomb: fix generation of message-id when sending attachments node was set to bin(node) before message-id was created
author Christian Ebert <blacktrash@gmx.net>
date Fri, 28 Jul 2006 22:17:32 +0200
parents d1fa79e7b07e
children 04d9b31faeca
files hgext/patchbomb.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/patchbomb.py	Fri Jul 28 10:47:02 2006 -0700
+++ b/hgext/patchbomb.py	Fri Jul 28 22:17:32 2006 +0200
@@ -135,17 +135,17 @@
             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: