diff hgext/patchbomb.py @ 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 084f07cacba0
children 0bcecf7d45b1
line wrap: on
line diff
--- 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: