help = 'username for SMTP authentication'),
make_option('-b', '--branch',
help = 'use BRANCH instead of the default one'),
+ make_option('--binary',
+ help = 'output a diff even for binary files',
+ action = 'store_true'),
make_option('-m', '--mbox',
help = 'generate an mbox file instead of sending',
action = 'store_true')]
"""
addr_list = []
- r = re.compile('^(signed-off-by|acked-by):\s+(.+)$', re.I)
+ r = re.compile('^(signed-off-by|acked-by|cc):\s+(.+)$', re.I)
for line in msg.split('\n'):
m = r.match(line)
if m:
else:
prefix_str = ''
+ if options.binary:
+ diff_flags = [ '--binary' ]
+ else:
+ diff_flags = []
+
total_nr_str = str(total_nr)
patch_nr_str = str(patch_nr).zfill(len(total_nr_str))
if total_nr > 1:
# for backward template compatibility
'endofheaders': '',
'diff': git.diff(rev1 = git_id('%s//bottom' % patch),
- rev2 = git_id('%s//top' % patch)),
+ rev2 = git_id('%s//top' % patch),
+ diff_flags = diff_flags ),
'diffstat': git.diffstat(rev1 = git_id('%s//bottom'%patch),
rev2 = git_id('%s//top' % patch)),
# for backward template compatibility
ref_id = msg_id
if options.mbox:
- print msg_string
+ out.stdout_raw(msg_string + '\n')
else:
- print 'Sending the cover message...',
- sys.stdout.flush()
+ out.start('Sending the cover message')
__send_message(smtpserver, from_addr, to_addr_list, msg_string,
sleep, smtpuser, smtppassword)
- print 'done'
+ out.done()
# send the patches
if options.template:
ref_id = msg_id
if options.mbox:
- print msg_string
+ out.stdout_raw(msg_string + '\n')
else:
- print 'Sending patch "%s"...' % p,
- sys.stdout.flush()
+ out.start('Sending patch "%s"' % p)
__send_message(smtpserver, from_addr, to_addr_list, msg_string,
sleep, smtpuser, smtppassword)
- print 'done'
+ out.done()