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

- "osc request show <id>": added --source-buildstatus option to print the buildstatus of the src package

- "osc request show <id> --interactive": added shortcut "b" to print the buildstatus of the src package
This commit is contained in:
Marcus Huewe 2010-09-14 16:02:21 +02:00
parent 986e71d575
commit 6d9c5cf228
2 changed files with 11 additions and 1 deletions

View File

@ -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':

View File

@ -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)