~mdw
/
stgit
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allows extraction of information about remotes.
[stgit]
/
stgit
/
commands
/
diff.py
diff --git
a/stgit/commands/diff.py
b/stgit/commands/diff.py
index
d765784
..
8678a0a
100644
(file)
--- a/
stgit/commands/diff.py
+++ b/
stgit/commands/diff.py
@@
-41,7
+41,8
@@
rev = '([patch][//[bottom | top]]) | <tree-ish> | base'
If neither bottom nor top are given but a '//' is present, the command
shows the specified patch (defaulting to the current one)."""
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('-s', '--stat',
help = 'show the stat instead of the diff',
help = 'show the diff between revisions'),
make_option('-s', '--stat',
help = 'show the stat instead of the diff',
@@
-52,15
+53,15
@@
def func(parser, options, args):
"""Show the tree diff
"""
if options.revs:
"""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]
rev_list_len = len(rev_list)
if rev_list_len == 1:
rev = rev_list[0]
- if rev
[-1] == '/'
:
+ if rev
.endswith('/')
:
# the whole patch
# the whole patch
- rev =
rev[:-1]
- if rev
[-1] == '/'
:
- rev =
rev[:-1]
+ rev =
strip_suffix('/', rev)
+ if rev
.endswith('/')
:
+ rev =
strip_suffix('/', rev)
rev1 = rev + '//bottom'
rev2 = rev + '//top'
else:
rev1 = rev + '//bottom'
rev2 = rev + '//top'
else:
@@
-78,4
+79,6
@@
def func(parser, options, args):
if options.stat:
print git.diffstat(args, git_id(rev1), git_id(rev2))
else:
if options.stat:
print git.diffstat(args, git_id(rev1), git_id(rev2))
else:
- pager(git.diff(args, git_id(rev1), git_id(rev2)))
+ diff_str = git.diff(args, git_id(rev1), git_id(rev2))
+ if diff_str:
+ pager(diff_str)