patchbomb: fix generation of message-id when sending attachments
authorChristian Ebert <blacktrash@gmx.net>
Fri, 28 Jul 2006 22:17:32 +0200
changeset 2722 10e95059ffd7
parent 2721 d1fa79e7b07e
child 2723 04d9b31faeca
patchbomb: fix generation of message-id when sending attachments node was set to bin(node) before message-id was created
hgext/patchbomb.py
--- 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: