1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-14 01:26:23 +01:00

add submitreq delete action (thanks to Dirk for the patch)

This commit is contained in:
Dr. Peter Poeml 2008-07-09 15:22:18 +00:00
parent acaef1d250
commit de0bb98200

View File

@ -431,6 +431,9 @@ class Osc(cmdln.Cmdln):
"decline" will change the request state to "declined" and append a "decline" will change the request state to "declined" and append a
message that you specify with the --message option. message that you specify with the --message option.
"delete" will change the request state to "deleted" and append a
message that you specify with the --message option.
"accept" will change the request state to "accepted" and will trigger "accept" will change the request state to "accepted" and will trigger
the actual submit process. That would normally be a server-side copy of the actual submit process. That would normally be a server-side copy of
the source package to the target package. the source package to the target package.
@ -442,13 +445,14 @@ class Osc(cmdln.Cmdln):
osc submitreq list [PRJ [PKG]] osc submitreq list [PRJ [PKG]]
osc submitreq show [-d] ID osc submitreq show [-d] ID
osc submitreq decline [-m TEXT] ID osc submitreq decline [-m TEXT] ID
osc submitreq delete [-m TEXT] ID
osc submitreq accept [-m TEXT] ID osc submitreq accept [-m TEXT] ID
${cmd_option_list} ${cmd_option_list}
""" """
args = slash_split(args) args = slash_split(args)
cmds = ['create', 'list', 'show', 'decline', 'accept'] cmds = ['create', 'list', 'show', 'decline', 'accept', 'delete']
if not args or args[0] not in cmds: if not args or args[0] not in cmds:
raise oscerr.WrongArgs('Unknown submitreq action. Choose one of %s.' \ raise oscerr.WrongArgs('Unknown submitreq action. Choose one of %s.' \
% ', '.join(cmds)) % ', '.join(cmds))
@ -510,7 +514,7 @@ class Osc(cmdln.Cmdln):
if len(args) > 1: if len(args) > 1:
package = args[1] package = args[1]
elif cmd in ['show', 'decline', 'accept']: elif cmd in ['show', 'decline', 'accept', 'delete']:
reqid = args[0] reqid = args[0]
@ -571,6 +575,11 @@ Please submit there instead, or use --nodevelproject to force direct submission.
r = change_submit_request_state(conf.config['apiurl'], r = change_submit_request_state(conf.config['apiurl'],
reqid, 'accepted', opts.message or '') reqid, 'accepted', opts.message or '')
print r print r
# delete
elif cmd == 'delete':
r = change_submit_request_state(conf.config['apiurl'],
reqid, 'deleted', opts.message or '')
print r
# editmeta and its aliases are all depracated # editmeta and its aliases are all depracated