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)
+ rev1 = git_id(crt_series, '%s^' % patch)
+ rev2 = git_id(crt_series, '%s' % patch)
if options.stat:
- output = gitlib.diffstat(git.diff(rev1 = rev1, rev2 = rev2))
- out.stdout_raw(git.diffstat(rev1 = rev1, rev2 = rev2,
- diff_flags = diff_flags) + '\n')
++ output = gitlib.diffstat(git.diff(rev1 = rev1, rev2 = rev2,
++ diff_flags = options.diff_flags))
elif options.bare:
- out.stdout_raw(git.barefiles(rev1, rev2) + '\n')
+ output = git.barefiles(rev1, rev2)
else:
- out.stdout_raw(git.files(rev1, rev2, diff_flags = diff_flags) + '\n')
+ output = git.files(rev1, rev2, diff_flags = options.diff_flags)
+ if output:
+ if not output.endswith('\n'):
+ output += '\n'
+ out.stdout_raw(output)
'number': number_str,
'shortlog': stack.shortlog(crt_series.get_patch(p)
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]),
- diff_flags = diff_flags)}
+ 'diffstat': gitlib.diffstat(git.diff(
+ rev1 = git_id(crt_series, '%s^' % patches[0]),
- rev2 = git_id(crt_series, '%s' % patches[-1])))}
++ rev2 = git_id(crt_series, '%s' % patches[-1]),
++ diff_flags = options.diff_flags))}
try:
msg_string = tmpl % tmpl_dict