Mercurial > hg > mercurial-crew-with-dirclash
comparison hgext/patchbomb.py @ 3253:03acd01520ac
merge with crew
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Thu, 05 Oct 2006 00:14:21 +0200 |
parents | 1e2941fda520 |
children | 0b5d626b354e |
comparison
equal
deleted
inserted
replaced
3252:c9cd63a6fce9 | 3253:03acd01520ac |
---|---|
63 # | 63 # |
64 # That should be all. Now your patchbomb is on its way out. | 64 # That should be all. Now your patchbomb is on its way out. |
65 | 65 |
66 from mercurial.demandload import * | 66 from mercurial.demandload import * |
67 demandload(globals(), '''email.MIMEMultipart email.MIMEText email.Utils | 67 demandload(globals(), '''email.MIMEMultipart email.MIMEText email.Utils |
68 mercurial:commands,hg,mail,ui,patch | 68 mercurial:cmdutil,commands,hg,mail,ui,patch |
69 os errno popen2 socket sys tempfile time''') | 69 os errno popen2 socket sys tempfile time''') |
70 from mercurial.i18n import gettext as _ | 70 from mercurial.i18n import gettext as _ |
71 from mercurial.node import * | 71 from mercurial.node import * |
72 | 72 |
73 try: | 73 try: |
144 patchname = [t for t in repo.nodetags(binnode) | 144 patchname = [t for t in repo.nodetags(binnode) |
145 if t.endswith('.patch') or t.endswith('.diff')] | 145 if t.endswith('.patch') or t.endswith('.diff')] |
146 if patchname: | 146 if patchname: |
147 patchname = patchname[0] | 147 patchname = patchname[0] |
148 elif total > 1: | 148 elif total > 1: |
149 patchname = commands.make_filename(repo, '%b-%n.patch', | 149 patchname = cmdutil.make_filename(repo, '%b-%n.patch', |
150 binnode, idx, total) | 150 binnode, idx, total) |
151 else: | 151 else: |
152 patchname = commands.make_filename(repo, '%b.patch', binnode) | 152 patchname = cmdutil.make_filename(repo, '%b.patch', binnode) |
153 p['Content-Disposition'] = 'inline; filename=' + patchname | 153 p['Content-Disposition'] = 'inline; filename=' + patchname |
154 msg.attach(p) | 154 msg.attach(p) |
155 else: | 155 else: |
156 body += '\n'.join(patch) | 156 body += '\n'.join(patch) |
157 msg = email.MIMEText.MIMEText(body) | 157 msg = email.MIMEText.MIMEText(body) |