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

bring back sr --diff option

This commit is contained in:
Adrian Schröter 2009-08-28 07:33:16 +00:00
parent 06dc5b9aae
commit 9e67dae8b7
2 changed files with 29 additions and 21 deletions

2
NEWS
View File

@ -1,5 +1,5 @@
0.121
- fixed osc req list -U to not look into the local dir
- fixed osc rq list -U to not look into the local dir
- added osc my ... pkg/prj/req shorthand commands
- add 'osc se' alias for 'osc search -e'
- add -b -m -M to 'osc search'

View File

@ -498,6 +498,8 @@ class Osc(cmdln.Cmdln):
@cmdln.option('--nodevelproject', action='store_true',
help='do not follow a defined devel project ' \
'(primary project where a package is developed)')
@cmdln.option('-d', '--diff', action='store_true',
help='show diff only instead of creating the actual request')
@cmdln.alias("sr")
@cmdln.alias("submitreq")
@cmdln.alias("submitpac")
@ -593,29 +595,35 @@ of the package %s primarily takes place.
Please submit there instead, or use --nodevelproject to force direct submission.""" \
% (devloc, dst_package)
sys.exit(1)
if opts.diff:
print 'old: %s/%s\nnew: %s/%s' %(dst_project, dst_package, src_project, src_package)
rdiff = server_diff(apiurl,
dst_project, dst_package, None,
src_project, src_package, None, True)
print rdiff
else:
reqs = get_request_list(apiurl, dst_project, dst_package, 'submit')
user = conf.get_apiurl_usr(apiurl)
myreqs = [ i for i in reqs if i.state.who == user ]
repl = ''
if len(myreqs) > 0:
print 'You already created the following submit request: %s.' % \
', '.join([str(i.reqid) for i in myreqs ])
repl = raw_input('Revoke the old requests? (y/N) ')
reqs = get_request_list(apiurl, dst_project, dst_package, 'submit')
user = conf.get_apiurl_usr(apiurl)
myreqs = [ i for i in reqs if i.state.who == user ]
repl = ''
if len(myreqs) > 0:
print 'You already created the following submit request: %s.' % \
', '.join([str(i.reqid) for i in myreqs ])
repl = raw_input('Revoke the old requests? (y/N) ')
if not opts.message:
opts.message = edit_message()
if not opts.message:
opts.message = edit_message()
result = create_submit_request(apiurl,
src_project, src_package,
dst_project, dst_package,
opts.message, orev=opts.revision)
if repl == 'y':
for req in myreqs:
change_request_state(apiurl, str(req.reqid), 'revoked',
'superseeded by %s' % result)
result = create_submit_request(apiurl,
src_project, src_package,
dst_project, dst_package,
opts.message, orev=opts.revision)
if repl == 'y':
for req in myreqs:
change_request_state(apiurl, str(req.reqid), 'revoked',
'superseeded by %s' % result)
print 'created request id', result
print 'created request id', result
@cmdln.option('-m', '--message', metavar='TEXT',