mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-22 21:16:16 +01:00
- support --source-buildstatus during interactive review
This commit is contained in:
parent
75f6b3fbc1
commit
add34d65cb
@ -1997,7 +1997,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
@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")')
|
||||
help='print the buildstatus of the source package (only works with "show" and the interactive review)')
|
||||
@cmdln.alias("rq")
|
||||
@cmdln.alias("review")
|
||||
# FIXME: rewrite this mess and split request and review
|
||||
@ -2281,7 +2281,9 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
if days == 0 or result.state.when > since or result.state.name == 'new':
|
||||
if (opts.interactive or conf.config['request_show_interactive']) and not opts.non_interactive:
|
||||
ignore_reviews = subcmd != 'review'
|
||||
request_interactive_review(apiurl, result, group=opts.group, ignore_reviews=ignore_reviews)
|
||||
request_interactive_review(apiurl, result, group=opts.group,
|
||||
ignore_reviews=ignore_reviews,
|
||||
source_buildstatus=opts.source_buildstatus)
|
||||
else:
|
||||
print(result.list_view(), '\n')
|
||||
else:
|
||||
@ -2320,7 +2322,9 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
return request_interactive_review(apiurl, r, 'e')
|
||||
elif (opts.interactive or conf.config['request_show_interactive']) and not opts.non_interactive:
|
||||
ignore_reviews = subcmd != 'review'
|
||||
return request_interactive_review(apiurl, r, group=opts.group, ignore_reviews=ignore_reviews)
|
||||
return request_interactive_review(apiurl, r, group=opts.group,
|
||||
ignore_reviews=ignore_reviews,
|
||||
source_buildstatus=opts.source_buildstatus)
|
||||
else:
|
||||
print(r)
|
||||
print_comments(apiurl, 'request', reqid)
|
||||
|
18
osc/core.py
18
osc/core.py
@ -6833,7 +6833,8 @@ def print_request_list(apiurl, project, package = None, states = ('new', 'review
|
||||
for r in requests:
|
||||
print(r.list_view(), '\n')
|
||||
|
||||
def request_interactive_review(apiurl, request, initial_cmd='', group=None, ignore_reviews=False):
|
||||
def request_interactive_review(apiurl, request, initial_cmd='', group=None,
|
||||
ignore_reviews=False, source_buildstatus=False):
|
||||
"""review the request interactively"""
|
||||
import tempfile, re
|
||||
|
||||
@ -6851,6 +6852,15 @@ def request_interactive_review(apiurl, request, initial_cmd='', group=None, igno
|
||||
def print_request(request):
|
||||
print(request)
|
||||
|
||||
def print_source_buildstatus(src_actions, newline=False):
|
||||
if newline:
|
||||
print()
|
||||
if not src_actions:
|
||||
print('unable to get source buildstatus: no source actions defined')
|
||||
for action in src_actions:
|
||||
print('%s/%s:' % (action.src_project, action.src_package))
|
||||
print('\n'.join(get_results(apiurl, action.src_project, action.src_package)))
|
||||
|
||||
print_request(request)
|
||||
try:
|
||||
prompt = '(a)ccept/(d)ecline/(r)evoke/c(l)one/(s)kip/(c)ancel > '
|
||||
@ -6864,6 +6874,8 @@ def request_interactive_review(apiurl, request, initial_cmd='', group=None, igno
|
||||
prompt = 'd(i)ff/(a)ccept/(d)ecline/(r)evoke/(b)uildstatus/c(l)one/(s)kip/(c)ancel > '
|
||||
editprj = ''
|
||||
orequest = None
|
||||
if source_buildstatus:
|
||||
print_source_buildstatus(src_actions, newline=True)
|
||||
while True:
|
||||
if initial_cmd:
|
||||
repl = initial_cmd
|
||||
@ -6899,9 +6911,7 @@ def request_interactive_review(apiurl, request, initial_cmd='', group=None, igno
|
||||
print('Aborting', file=sys.stderr)
|
||||
raise oscerr.UserAbort()
|
||||
elif repl == 'b' and src_actions:
|
||||
for action in src_actions:
|
||||
print('%s/%s:' % (action.src_project, action.src_package))
|
||||
print('\n'.join(get_results(apiurl, action.src_project, action.src_package)))
|
||||
print_source_buildstatus(src_actions)
|
||||
elif repl == 'e' and editable_actions:
|
||||
# this is only for editable actions
|
||||
if not editprj:
|
||||
|
Loading…
Reference in New Issue
Block a user