# HG changeset patch # User Christian Ebert # Date 1153917573 -7200 # Node ID f1de91be1d875787a7893da9622cea7264988cc3 # Parent a781df9b5faa382ea0b20e3d7c598f078160b5ea optionally send blind carbon copies Bcc recipients may be set via long `--bcc' or hgrc only, no prompt. diff -r a781df9b5faa -r f1de91be1d87 hgext/patchbomb.py --- a/hgext/patchbomb.py Wed Jul 26 15:21:20 2006 +0200 +++ b/hgext/patchbomb.py Wed Jul 26 14:39:33 2006 +0200 @@ -38,6 +38,7 @@ # from = My Name # to = recipient1, recipient2, ... # cc = cc1, cc2, ... +# bcc = bcc1, bcc2, ... from mercurial.demandload import * demandload(globals(), '''email.MIMEMultipart email.MIMEText email.Utils @@ -185,6 +186,10 @@ to = getaddrs('to', 'To') cc = getaddrs('cc', 'Cc', '') + bcc = opts['bcc'] or (ui.config('email', 'bcc') or + ui.config('patchbomb', 'bcc') or '').split(',') + bcc = [a.strip() for a in bcc if a.strip()] + if len(patches) > 1: ui.write(_('\nWrite the introductory message for the patch series.\n\n')) @@ -240,7 +245,8 @@ start_time += 1 m['From'] = sender m['To'] = ', '.join(to) - if cc: m['Cc'] = ', '.join(cc) + if cc: m['Cc'] = ', '.join(cc) + if bcc: m['Bcc'] = ', '.join(bcc) if opts['test']: ui.status('Displaying ', m['Subject'], ' ...\n') fp = os.popen(os.getenv('PAGER', 'more'), 'w') @@ -261,12 +267,13 @@ fp.close() else: ui.status('Sending ', m['Subject'], ' ...\n') - mail.sendmail(sender, to + cc, m.as_string(0)) + mail.sendmail(sender, to + bcc + cc, m.as_string(0)) cmdtable = { 'email': (patchbomb, - [('c', 'cc', [], 'email addresses of copy recipients'), + [('', 'bcc', [], 'email addresses of blind copy recipients'), + ('c', 'cc', [], 'email addresses of copy recipients'), ('d', 'diffstat', None, 'add diffstat output to messages'), ('f', 'from', '', 'email address of sender'), ('', 'plain', None, 'omit hg patch header'),