mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-10 06:46:15 +01:00
Add -a/-s all option to osc rq list. It preselects all states for the query.
This commit is contained in:
parent
906972d5f0
commit
d2c9b0707d
@ -680,6 +680,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
help='specify message TEXT')
|
help='specify message TEXT')
|
||||||
@cmdln.option('-t', '--type', metavar='TEXT',
|
@cmdln.option('-t', '--type', metavar='TEXT',
|
||||||
help='limit to requests which contain a given action type (submit/delete/change_devel)')
|
help='limit to requests which contain a given action type (submit/delete/change_devel)')
|
||||||
|
@cmdln.option('-a', '--all', action='store_true',
|
||||||
|
help='all states')
|
||||||
@cmdln.option('-s', '--state', default='new',
|
@cmdln.option('-s', '--state', default='new',
|
||||||
help='only list requests in one of the comma separated given states (new/accepted/rejected/revoked/declined) [default=new]')
|
help='only list requests in one of the comma separated given states (new/accepted/rejected/revoked/declined) [default=new]')
|
||||||
@cmdln.option('-b', '--brief', action='store_true', default=False,
|
@cmdln.option('-b', '--brief', action='store_true', default=False,
|
||||||
@ -782,6 +784,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
who = ''
|
who = ''
|
||||||
if opts.mine:
|
if opts.mine:
|
||||||
who = conf.get_apiurl_usr(apiurl)
|
who = conf.get_apiurl_usr(apiurl)
|
||||||
|
if opts.all:
|
||||||
|
state_list = ('new', 'accepted', 'declined', 'revoked', 'rejected')
|
||||||
|
|
||||||
results = get_request_list(apiurl,
|
results = get_request_list(apiurl,
|
||||||
project, package, who, state_list, opts.type)
|
project, package, who, state_list, opts.type)
|
||||||
|
@ -2300,6 +2300,8 @@ def get_request_list(apiurl, project, package, req_who='', req_state=('new',), r
|
|||||||
matches = []
|
matches = []
|
||||||
match=''
|
match=''
|
||||||
m=''
|
m=''
|
||||||
|
if "all" in req_state:
|
||||||
|
req_state=('new', 'accepted', 'declined', 'revoked', 'rejected')
|
||||||
for state in req_state:
|
for state in req_state:
|
||||||
if len(m): m += '%20or%20'
|
if len(m): m += '%20or%20'
|
||||||
m += 'state/@name=\'%s\'' % quote_plus(state)
|
m += 'state/@name=\'%s\'' % quote_plus(state)
|
||||||
|
Loading…
Reference in New Issue
Block a user