Show More
@@ -45,6 +45,7 b" demandload(globals(), '''email.MIMEMulti" | |||
|
45 | 45 | mercurial:commands,hg,ui |
|
46 | 46 | os errno popen2 socket sys tempfile time''') |
|
47 | 47 | from mercurial.i18n import gettext as _ |
|
48 | from mercurial.node import * | |
|
48 | 49 | |
|
49 | 50 | try: |
|
50 | 51 | # readline gives raw_input editing capabilities, but is not |
@@ -133,7 +134,20 b' def patchbomb(ui, repo, *revs, **opts):' | |||
|
133 | 134 | if opts['attach']: |
|
134 | 135 | msg = email.MIMEMultipart.MIMEMultipart() |
|
135 | 136 | if body: msg.attach(email.MIMEText.MIMEText(body, 'plain')) |
|
136 |
|
|
|
137 | p = email.MIMEText.MIMEText('\n'.join(patch), 'x-patch') | |
|
138 | node = bin(node) | |
|
139 | # if node is mq patch, it will have patch file name as tag | |
|
140 | patchname = [t for t in repo.nodetags(node) | |
|
141 | if t.endswith('.patch') or t.endswith('.diff')] | |
|
142 | if patchname: | |
|
143 | patchname = patchname[0] | |
|
144 | elif total > 1: | |
|
145 | patchname = commands.make_filename(repo, '%b-%n.patch', | |
|
146 | node, idx, total) | |
|
147 | else: | |
|
148 | patchname = commands.make_filename(repo, '%b.patch', node) | |
|
149 | p['Content-Disposition'] = 'inline; filename=' + patchname | |
|
150 | msg.attach(p) | |
|
137 | 151 | else: |
|
138 | 152 | body += '\n'.join(patch) |
|
139 | 153 | msg = email.MIMEText.MIMEText(body) |
General Comments 0
You need to be logged in to leave comments.
Login now