X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/fdf4cb43a1c8133e013fd8ca2d1a5753ea048c90..0d219030bbc792da477f721578e0acc1256fc6d0:/stgit/commands/diff.py diff --git a/stgit/commands/diff.py b/stgit/commands/diff.py index 9abd438..b66c75b 100644 --- a/stgit/commands/diff.py +++ b/stgit/commands/diff.py @@ -41,8 +41,12 @@ rev = '([patch][//[bottom | top]]) | | base' If neither bottom nor top are given but a '//' is present, the command shows the specified patch (defaulting to the current one).""" -options = [make_option('-r', metavar = 'rev1[:[rev2]]', dest = 'revs', +options = [make_option('-r', '--range', + metavar = 'rev1[..[rev2]]', dest = 'revs', help = 'show the diff between revisions'), + make_option('--binary', + help = 'output a diff even for binary files', + action = 'store_true'), make_option('-s', '--stat', help = 'show the stat instead of the diff', action = 'store_true')] @@ -52,7 +56,7 @@ def func(parser, options, args): """Show the tree diff """ if options.revs: - rev_list = options.revs.split(':') + rev_list = options.revs.split('..') rev_list_len = len(rev_list) if rev_list_len == 1: rev = rev_list[0] @@ -75,9 +79,15 @@ def func(parser, options, args): rev1 = 'HEAD' rev2 = None + if options.binary: + diff_flags = [ '--binary' ] + else: + diff_flags = [] + if options.stat: - print git.diffstat(args, git_id(rev1), git_id(rev2)) + out.stdout_raw(git.diffstat(args, git_id(rev1), git_id(rev2)) + '\n') else: - diff_str = git.diff(args, git_id(rev1), git_id(rev2)) + diff_str = git.diff(args, git_id(rev1), git_id(rev2), + diff_flags = diff_flags ) if diff_str: pager(diff_str)