1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-12 23:56:13 +01:00

Do not ignore --type parameter in "osc review list --type..."

There is no reason why we should ignore the --type parameter in this
case.
This commit is contained in:
Marcus Huewe 2017-08-24 12:01:19 +02:00
parent 54ee1cdba2
commit 1c21c67659
2 changed files with 7 additions and 2 deletions

View File

@ -2283,7 +2283,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
if subcmd == 'review':
# FIXME: do the review list for the user and for all groups he belong to
results = get_review_list(apiurl, project, package, who, opts.group, opts.project, opts.package, state_list)
results = get_review_list(apiurl, project, package, who, opts.group, opts.project, opts.package, state_list,
opts.type)
else:
if opts.involved_projects:
who = who or conf.get_apiurl_usr(apiurl)

View File

@ -4227,7 +4227,8 @@ def change_request_state_template(req, newstate):
print('error: cannot interpolate \'%s\' in \'%s\'' % (e.args[0], tmpl_name), file=sys.stderr)
return ''
def get_review_list(apiurl, project='', package='', byuser='', bygroup='', byproject='', bypackage='', states=()):
def get_review_list(apiurl, project='', package='', byuser='', bygroup='', byproject='', bypackage='', states=(),
req_type=''):
# this is so ugly...
def build_by(xpath, val):
if 'all' in states:
@ -4257,6 +4258,9 @@ def get_review_list(apiurl, project='', package='', byuser='', bygroup='', bypro
elif byproject:
xpath = build_by(xpath, '@by_project=\'%s\'' % byproject)
if req_type:
xpath = xpath_join(xpath, 'action/@type=\'%s\'' % req_type, op='and')
# XXX: we cannot use the '|' in the xpath expression because it is not supported
# in the backend
todo = {}