1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-12 16:56:15 +01:00

- request_interactive_review: added support to accept/decline a specific review instead of all

This commit is contained in:
Marcus Huewe 2011-09-16 17:32:42 +02:00
parent d3dd8539d9
commit 5707f2c6f4

View File

@ -5987,7 +5987,26 @@ def request_interactive_review(apiurl, request, initial_cmd=''):
elif state is None:
clone_request(apiurl, request.reqid, msg)
else:
change_request_state(apiurl, request.reqid, state, msg)
reviews = [r for r in request.reviews if r.state == 'new']
if not reviews:
change_request_state(apiurl, request.reqid, state, msg)
print 'Please chose one of the following reviews:'
for i in range(len(reviews)):
fmt = Request.format_review(reviews[i])
print '(%i)' % i, 'by %(type)-10s %(by)s' % fmt
num = raw_input('> ')
try:
num = int(num)
except ValueError:
print '\'%s\' is not a number.' % num
continue
if num < 0 or num >= len(reviews):
print 'number \'%s\' out of range.' % num
continue
review = reviews[num]
change_review_state(apiurl, request.reqid, state, by_user=review.by_user,
by_group=review.by_group, by_project=review.by_project,
by_package=review.by_package, message=msg)
break
finally:
if tmpfile is not None: