##// END OF EJS Templates
patchbomb: Allow to specify subject of single-patch-series (issue475)
Thomas Arendsen Hein -
r4141:49d7a035 default
parent child Browse files
Show More
@@ -155,12 +155,14 b' def patchbomb(ui, repo, *revs, **opts):'
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)
158
159 subj = desc[0].strip()
160 if subj.endswith('.'): subj = subj[:-1]
158 if total == 1:
161 if total == 1:
159 subj = '[PATCH] ' + desc[0].strip()
162 subj = '[PATCH] ' + (opts['subject'] or subj)
160 else:
163 else:
161 tlen = len(str(total))
164 tlen = len(str(total))
162 subj = '[PATCH %0*d of %d] %s' % (tlen, idx, total, desc[0].strip())
165 subj = '[PATCH %0*d of %d] %s' % (tlen, idx, total, subj)
163 if subj.endswith('.'): subj = subj[:-1]
164 msg['Subject'] = subj
166 msg['Subject'] = subj
165 msg['X-Mercurial-Node'] = node
167 msg['X-Mercurial-Node'] = node
166 return msg
168 return msg
@@ -309,7 +311,7 b' cmdtable = {'
309 ('', 'plain', None, 'omit hg patch header'),
311 ('', 'plain', None, 'omit hg patch header'),
310 ('n', 'test', None, 'print messages that would be sent'),
312 ('n', 'test', None, 'print messages that would be sent'),
311 ('m', 'mbox', '', 'write messages to mbox file instead of sending them'),
313 ('m', 'mbox', '', 'write messages to mbox file instead of sending them'),
312 ('s', 'subject', '', 'subject of introductory message'),
314 ('s', 'subject', '', 'subject of first message (intro or single patch)'),
313 ('t', 'to', [], 'email addresses of recipients')],
315 ('t', 'to', [], 'email addresses of recipients')],
314 "hg email [OPTION]... [REV]...")
316 "hg email [OPTION]... [REV]...")
315 }
317 }
General Comments 0
You need to be logged in to leave comments. Login now