summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
d323b5d)
Useful to automatically bcc the e-mails to a given address.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
#commname: Your Name
#commemail: your.name@yourcompany.com
#commname: Your Name
#commemail: your.name@yourcompany.com
+# Automatically Bcc the address below
+#autobcc: your.name@yourcompany.com
+
# Set to 'yes' if you don't want to use the 'resolved' command.
# 'refresh' will automatically mark the conflicts as resolved
#autoresolved: no
# Set to 'yes' if you don't want to use the 'resolved' command.
# 'refresh' will automatically mark the conflicts as resolved
#autoresolved: no
template.
"""
def csv(lst):
template.
"""
def csv(lst):
- return reduce(lambda x, y: x + ', ' + y, lst)
+ s = ''
+ for i in lst:
+ if not i:
+ continue
+ if s:
+ s += ', ' + i
+ else:
+ s = i
+ return s
def replace_header(header, addr, tmpl):
r = re.compile('^' + header + ':\s+.+$', re.I | re.M)
def replace_header(header, addr, tmpl):
r = re.compile('^' + header + ':\s+.+$', re.I | re.M)
cc_addr = ''
bcc_addr = ''
cc_addr = ''
bcc_addr = ''
+ if config.has_option('stgit', 'autobcc'):
+ autobcc = config.get('stgit', 'autobcc')
+ else:
+ autobcc = ''
+
if options.to:
to_addr = csv(options.to)
if options.cc:
if options.to:
to_addr = csv(options.to)
if options.cc:
elif extra_cc:
cc_addr = csv(extra_cc)
if options.bcc:
elif extra_cc:
cc_addr = csv(extra_cc)
if options.bcc:
- bcc_addr = csv(options.bcc)
+ bcc_addr = csv(options.bcc + [autobcc])
+ elif autobcc:
+ bcc_addr = autobcc
# replace existing headers
if to_addr:
# replace existing headers
if to_addr: