From 6d9c5cf2285d90f14ac81980d0d33c206f49c9a6 Mon Sep 17 00:00:00 2001 From: Marcus Huewe Date: Tue, 14 Sep 2010 16:02:21 +0200 Subject: [PATCH] - "osc request show ": added --source-buildstatus option to print the buildstatus of the src package - "osc request show --interactive": added shortcut "b" to print the buildstatus of the src package --- osc/commandline.py | 8 ++++++++ osc/core.py | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/osc/commandline.py b/osc/commandline.py index 152b30de..48638ed6 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -1542,6 +1542,8 @@ Please submit there instead, or use --nodevelproject to force direct submission. help='exclude target project from request list') @cmdln.option('--involved-projects', action='store_true', help='show all requests for project/packages where USER is involved') + @cmdln.option('--source-buildstatus', action='store_true', + help='print the buildstatus of the source package (only works with "show")') @cmdln.alias("rq") @cmdln.alias("review") def do_request(self, subcmd, opts, *args): @@ -1787,6 +1789,12 @@ Please submit there instead, or use --nodevelproject to force direct submission. return request_interactive_review(apiurl, r) else: print r + if opts.source_buildstatus: + if r.actions[0].type != 'submit': + raise oscerr.WrongOptions( '\'--source-buildstatus\' is not possible for ' \ + 'request type: \'%s\'' % r.actions[0].type) + print 'Buildstatus for \'%s/%s\':' % (r.actions[0].src_project, r.actions[0].src_package) + print '\n'.join(get_results(apiurl, r.actions[0].src_project, r.actions[0].src_package)) # FIXME: will inevitably fail if the given target doesn't exist # FIXME: diff should work if there are submit actions anyway if opts.diff and r.actions[0].type != 'submit': diff --git a/osc/core.py b/osc/core.py index 0f55e1f8..cb900d4c 100644 --- a/osc/core.py +++ b/osc/core.py @@ -5443,7 +5443,7 @@ def request_interactive_review(apiurl, request): print request.__str__().encode('ascii', 'xmlcharrefreplace') print_request(request) try: - msg = '(a)ccept/(d)ecline/(r)evoke/(c)ancel > ' + msg = '(a)ccept/(d)ecline/(r)evoke/(b)uildstatus/(c)ancel > ' if request.actions[0].type == 'submit': msg = 'd(i)ff/%s' % msg while True: @@ -5483,6 +5483,8 @@ def request_interactive_review(apiurl, request): elif repl == 'c': print >>sys.stderr, 'Aborting' raise oscerr.UserAbort() + elif repl == 'b': + print '\n'.join(get_results(apiurl, request.actions[0].src_project, request.actions[0].src_package)) else: state_map = {'a': 'accepted', 'd': 'declined', 'r': 'revoked'} mo = re.search('^([adr])(?:\s+-m\s+(.*))?$', repl)