mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-27 02:16:12 +01:00
added diff -c option (show change of revision X = diff -r X-1:X)
This commit is contained in:
parent
eeba81ad26
commit
7406d0ed34
@ -1101,6 +1101,9 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
|
||||
|
||||
@cmdln.alias('di')
|
||||
@cmdln.option('-c', '--change', metavar='rev',
|
||||
help='the change made by revision rev (like -r rev-1:rev).'
|
||||
'If rev is negative this is like -r rev:rev-1.')
|
||||
@cmdln.option('-r', '--revision', metavar='rev1[:rev2]',
|
||||
help='If rev1 is specified it will compare your working copy against '
|
||||
'the revision (rev1) on the server. '
|
||||
@ -1123,6 +1126,20 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
args = parseargs(args)
|
||||
pacs = findpacs(args)
|
||||
|
||||
if opts.change:
|
||||
try:
|
||||
rev = int(opts.change)
|
||||
if rev > 0:
|
||||
rev1 = rev - 1
|
||||
rev2 = rev
|
||||
elif rev < 0:
|
||||
rev1 = -rev
|
||||
rev2 = -rev - 1
|
||||
else:
|
||||
return
|
||||
except:
|
||||
return
|
||||
else:
|
||||
rev1, rev2 = parseRevisionOption(opts.revision)
|
||||
diff = ''
|
||||
for pac in pacs:
|
||||
|
Loading…
Reference in New Issue
Block a user