1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-14 00:06:15 +01:00

added diff -c option (show change of revision X = diff -r X-1:X)

This commit is contained in:
Pavol Rusnak 2009-05-18 14:50:43 +00:00
parent eeba81ad26
commit 7406d0ed34

View File

@ -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,7 +1126,21 @@ Please submit there instead, or use --nodevelproject to force direct submission.
args = parseargs(args)
pacs = findpacs(args)
rev1, rev2 = parseRevisionOption(opts.revision)
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:
if not rev2: