From 073e2b0517179579988fb00227f15fe78f76303d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Tue, 29 Jun 2010 12:12:34 +0200 Subject: [PATCH] support re-open of requests --- NEWS | 1 + osc/commandline.py | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index ff0b8dd2..f9d2efc8 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,6 @@ 0.128 - better default commands selection for editor/pager + - support "osc rq reopen" to set a request in new state again 0.127 - add size limit mode, files can be ignored on checkout or update given a certain size limit. diff --git a/osc/commandline.py b/osc/commandline.py index 3c156b19..e29ba8ea 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -1485,6 +1485,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. osc request log ID osc request [show] [-d] [-b] ID osc request accept [-m TEXT] ID + osc request reopen [-m TEXT] ID osc request approvenew [-m TEXT] PROJECT osc request decline [-m TEXT] ID osc request revoke [-m TEXT] ID @@ -1517,7 +1518,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. if opts.state == '': opts.state = 'new' - cmds = ['list', 'log', 'show', 'decline', 'accept', 'approvenew', 'wipe', 'revoke', 'checkout', 'co', 'help'] + cmds = ['list', 'log', 'show', 'decline', 'reopen', 'accept', 'approvenew', 'wipe', 'revoke', 'checkout', 'co', 'help'] if not args or args[0] not in cmds: raise oscerr.WrongArgs('Unknown request action %s. Choose one of %s.' \ % (args[0],', '.join(cmds))) @@ -1553,7 +1554,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. if len(args) > 1: package = args[1] - elif cmd in ['log', 'show', 'decline', 'accept', 'wipe', 'revoke', 'checkout', 'co']: + elif cmd in ['log', 'show', 'decline', 'reopen', 'accept', 'wipe', 'revoke', 'checkout', 'co']: reqid = args[0] # list and approvenew @@ -1679,7 +1680,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. else: if not opts.message: opts.message = edit_message() - state_map = {'accept' : 'accepted', 'decline' : 'declined', 'wipe' : 'deleted', 'revoke' : 'revoked'} + state_map = {'reopen' : 'new', 'accept' : 'accepted', 'decline' : 'declined', 'wipe' : 'deleted', 'revoke' : 'revoked'} # Change review state only if subcmd == 'review': if cmd in ['accept', 'decline', 'new']: @@ -1687,7 +1688,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. reqid, state_map[cmd], conf.config['user'], '', opts.message or '') print r # Change state of entire request - elif cmd in ['accept', 'decline', 'wipe', 'revoke']: + elif cmd in ['reopen', 'accept', 'decline', 'wipe', 'revoke']: r = change_request_state(conf.config['apiurl'], reqid, state_map[cmd], opts.message or '') print r