else:
parser.error('incorrect number of arguments')
+ if options.diff_opts:
+ diff_flags = options.diff_opts.split()
+ else:
+ diff_flags = []
+
rev1 = git_id(crt_series, '%s//bottom' % patch)
rev2 = git_id(crt_series, '%s//top' % patch)
if options.stat:
- out.stdout_raw(git.diffstat(rev1 = rev1, rev2 = rev2) + '\n')
+ out.stdout_raw(git.diffstat(rev1 = rev1, rev2 = rev2,
+ diff_flags = diff_flags) + '\n')
elif options.bare:
out.stdout_raw(git.barefiles(rev1, rev2) + '\n')
else:
- if options.diff_opts:
- diff_flags = options.diff_opts.split()
- else:
- diff_flags = []
-
out.stdout_raw(git.files(rev1, rev2, diff_flags = diff_flags) + '\n')
else:
number_str = ''
+ if options.diff_opts:
+ diff_flags = options.diff_opts.split()
+ else:
+ diff_flags = []
+
tmpl_dict = {'sender': sender,
# for backward template compatibility
'maintainer': sender,
for p in patches),
'diffstat': git.diffstat(
rev1 = git_id(crt_series, '%s//bottom' % patches[0]),
- rev2 = git_id(crt_series, '%s//top' % patches[-1]))}
+ rev2 = git_id(crt_series, '%s//top' % patches[-1]),
+ diff_flags = diff_flags)}
try:
msg_string = tmpl % tmpl_dict
diff_flags = diff_flags),
'diffstat': git.diffstat(
rev1 = git_id(crt_series, '%s//bottom'%patch),
- rev2 = git_id(crt_series, '%s//top' % patch)),
+ rev2 = git_id(crt_series, '%s//top' % patch),
+ diff_flags = diff_flags),
# for backward template compatibility
'date': '',
'version': version_str,
# TODO: take another parameter representing a diff string as we
# usually invoke git.diff() form the calling functions
-def diffstat(files = None, rev1 = 'HEAD', rev2 = None):
+def diffstat(files = None, rev1 = 'HEAD', rev2 = None, diff_flags = []):
"""Return the diffstat between rev1 and rev2."""
return GRun('apply', '--stat', '--summary'
- ).raw_input(diff(files, rev1, rev2)).raw_output()
+ ).raw_input(diff(files, rev1, rev2, diff_flags = diff_flags)
+ ).raw_output()
def files(rev1, rev2, diff_flags = []):
"""Return the files modified between rev1 and rev2