Show More
@@ -38,6 +38,7 b'' | |||||
38 | # from = My Name <my@email> |
|
38 | # from = My Name <my@email> | |
39 | # to = recipient1, recipient2, ... |
|
39 | # to = recipient1, recipient2, ... | |
40 | # cc = cc1, cc2, ... |
|
40 | # cc = cc1, cc2, ... | |
|
41 | # bcc = bcc1, bcc2, ... | |||
41 |
|
42 | |||
42 | from mercurial.demandload import * |
|
43 | from mercurial.demandload import * | |
43 | demandload(globals(), '''email.MIMEMultipart email.MIMEText email.Utils |
|
44 | demandload(globals(), '''email.MIMEMultipart email.MIMEText email.Utils | |
@@ -185,6 +186,10 b' def patchbomb(ui, repo, *revs, **opts):' | |||||
185 | to = getaddrs('to', 'To') |
|
186 | to = getaddrs('to', 'To') | |
186 | cc = getaddrs('cc', 'Cc', '') |
|
187 | cc = getaddrs('cc', 'Cc', '') | |
187 |
|
188 | |||
|
189 | bcc = opts['bcc'] or (ui.config('email', 'bcc') or | |||
|
190 | ui.config('patchbomb', 'bcc') or '').split(',') | |||
|
191 | bcc = [a.strip() for a in bcc if a.strip()] | |||
|
192 | ||||
188 | if len(patches) > 1: |
|
193 | if len(patches) > 1: | |
189 | ui.write(_('\nWrite the introductory message for the patch series.\n\n')) |
|
194 | ui.write(_('\nWrite the introductory message for the patch series.\n\n')) | |
190 |
|
195 | |||
@@ -240,7 +245,8 b' def patchbomb(ui, repo, *revs, **opts):' | |||||
240 | start_time += 1 |
|
245 | start_time += 1 | |
241 | m['From'] = sender |
|
246 | m['From'] = sender | |
242 | m['To'] = ', '.join(to) |
|
247 | m['To'] = ', '.join(to) | |
243 | if cc: m['Cc'] = ', '.join(cc) |
|
248 | if cc: m['Cc'] = ', '.join(cc) | |
|
249 | if bcc: m['Bcc'] = ', '.join(bcc) | |||
244 | if opts['test']: |
|
250 | if opts['test']: | |
245 | ui.status('Displaying ', m['Subject'], ' ...\n') |
|
251 | ui.status('Displaying ', m['Subject'], ' ...\n') | |
246 | fp = os.popen(os.getenv('PAGER', 'more'), 'w') |
|
252 | fp = os.popen(os.getenv('PAGER', 'more'), 'w') | |
@@ -261,12 +267,13 b' def patchbomb(ui, repo, *revs, **opts):' | |||||
261 | fp.close() |
|
267 | fp.close() | |
262 | else: |
|
268 | else: | |
263 | ui.status('Sending ', m['Subject'], ' ...\n') |
|
269 | ui.status('Sending ', m['Subject'], ' ...\n') | |
264 | mail.sendmail(sender, to + cc, m.as_string(0)) |
|
270 | mail.sendmail(sender, to + bcc + cc, m.as_string(0)) | |
265 |
|
271 | |||
266 | cmdtable = { |
|
272 | cmdtable = { | |
267 | 'email': |
|
273 | 'email': | |
268 | (patchbomb, |
|
274 | (patchbomb, | |
269 |
[(' |
|
275 | [('', 'bcc', [], 'email addresses of blind copy recipients'), | |
|
276 | ('c', 'cc', [], 'email addresses of copy recipients'), | |||
270 | ('d', 'diffstat', None, 'add diffstat output to messages'), |
|
277 | ('d', 'diffstat', None, 'add diffstat output to messages'), | |
271 | ('f', 'from', '', 'email address of sender'), |
|
278 | ('f', 'from', '', 'email address of sender'), | |
272 | ('', 'plain', None, 'omit hg patch header'), |
|
279 | ('', 'plain', None, 'omit hg patch header'), |
General Comments 0
You need to be logged in to leave comments.
Login now