mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-10 06:46:15 +01:00
* add "osc request list -t <type>" to list only submit, delete or
develchange requests * fix support of listing requests with multiple actions
This commit is contained in:
parent
2adaaeba09
commit
d017b16426
6
NEWS
6
NEWS
@ -1,7 +1,9 @@
|
|||||||
0.120:
|
0.120:
|
||||||
- support "setlinkrev" for whole projects
|
- support "setlinkrev" for whole projects
|
||||||
- support "setlinkrev -u" for removing revision references
|
- add "setlinkrev --unset" for removing revision references
|
||||||
- added dist directory with completion scripts for packaging
|
- add "osc request list -t <type>" to list only submit, delete or develchange requests
|
||||||
|
- add shell completion scripts
|
||||||
|
- fix support of listing requests with multiple actions
|
||||||
|
|
||||||
0.119:
|
0.119:
|
||||||
- Support new request types
|
- Support new request types
|
||||||
|
@ -656,6 +656,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
help='output the diff in the unified diff format')
|
help='output the diff in the unified diff format')
|
||||||
@cmdln.option('-m', '--message', metavar='TEXT',
|
@cmdln.option('-m', '--message', metavar='TEXT',
|
||||||
help='specify message TEXT')
|
help='specify message TEXT')
|
||||||
|
@cmdln.option('-t', '--type', metavar='TEXT',
|
||||||
|
help='limit to requests which contain a given action type (submit/delete/develchange)')
|
||||||
@cmdln.option('-s', '--state', default='new',
|
@cmdln.option('-s', '--state', default='new',
|
||||||
help='only list requests in one of the comma separated given states [default=new]')
|
help='only list requests in one of the comma separated given states [default=new]')
|
||||||
@cmdln.option('-b', '--brief', action='store_true', default=False,
|
@cmdln.option('-b', '--brief', action='store_true', default=False,
|
||||||
@ -700,7 +702,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
|
|
||||||
|
|
||||||
usage:
|
usage:
|
||||||
osc request list [-M] [PRJ [PKG]]
|
osc request list [-M] [-t type] [PRJ [PKG]]
|
||||||
osc request log ID
|
osc request log ID
|
||||||
osc request show [-d] [-b] ID
|
osc request show [-d] [-b] ID
|
||||||
osc request accept [-m TEXT] ID
|
osc request accept [-m TEXT] ID
|
||||||
@ -760,7 +762,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
who = conf.get_apiurl_usr(apiurl)
|
who = conf.get_apiurl_usr(apiurl)
|
||||||
|
|
||||||
results = get_request_list(apiurl,
|
results = get_request_list(apiurl,
|
||||||
project, package, who, state_list)
|
project, package, who, state_list, opts.type)
|
||||||
|
|
||||||
results.sort(reverse=True)
|
results.sort(reverse=True)
|
||||||
|
|
||||||
|
51
osc/core.py
51
osc/core.py
@ -80,8 +80,8 @@ It also does some weird stuff.
|
|||||||
<arch>x86_64</arch>
|
<arch>x86_64</arch>
|
||||||
<arch>i586</arch>
|
<arch>i586</arch>
|
||||||
</repository>
|
</repository>
|
||||||
<repository name="Fedora_10">
|
<repository name="Fedora_11">
|
||||||
<path project="Fedora:10" repository="standard" />
|
<path project="Fedora:11" repository="standard" />
|
||||||
<arch>x86_64</arch>
|
<arch>x86_64</arch>
|
||||||
<arch>i586</arch>
|
<arch>i586</arch>
|
||||||
</repository>
|
</repository>
|
||||||
@ -1271,21 +1271,12 @@ class Request:
|
|||||||
type = action.get('type', 'submit')
|
type = action.get('type', 'submit')
|
||||||
try:
|
try:
|
||||||
n = action.find('source')
|
n = action.find('source')
|
||||||
if n:
|
src_prj = n.get('project', None)
|
||||||
src_prj = n.get('project')
|
src_pkg = n.get('package', None)
|
||||||
src_pkg = n.get('package')
|
src_rev = n.get('rev', None)
|
||||||
src_rev = n.get('rev', None)
|
|
||||||
else:
|
|
||||||
src_prj = None
|
|
||||||
src_pkg = None
|
|
||||||
src_rev = None
|
|
||||||
n = action.find('target')
|
n = action.find('target')
|
||||||
if n:
|
dst_prj = n.get('project', None)
|
||||||
dst_prj = n.get('project')
|
dst_pkg = n.get('package', None)
|
||||||
dst_pkg = n.get('package', None)
|
|
||||||
else:
|
|
||||||
dst_prj = None
|
|
||||||
dst_pkg = None
|
|
||||||
self.add_action(type, src_prj, src_pkg, src_rev, dst_prj, dst_pkg)
|
self.add_action(type, src_prj, src_pkg, src_rev, dst_prj, dst_pkg)
|
||||||
except:
|
except:
|
||||||
msg = 'invalid request format:\n%s' % ET.tostring(root)
|
msg = 'invalid request format:\n%s' % ET.tostring(root)
|
||||||
@ -1326,19 +1317,22 @@ class Request:
|
|||||||
)
|
)
|
||||||
|
|
||||||
def list_view(self):
|
def list_view(self):
|
||||||
dst = "%s/%s" % (self.actions[0].dst_project, self.actions[0].dst_package)
|
ret = '%6d State:%-7s Creator:%-12s When:%-12s' % (self.reqid, self.state.name, self.state.who, self.state.when)
|
||||||
if self.actions[0].src_package == self.actions[0].dst_package:
|
|
||||||
dst = self.actions[0].dst_project
|
for a in self.actions:
|
||||||
|
dst = "%s/%s" % (a.dst_project, a.dst_package)
|
||||||
|
if a.src_package == a.dst_package:
|
||||||
|
dst = a.dst_project
|
||||||
|
|
||||||
|
ret += '\n %s: %-50s -> %-20s ' % \
|
||||||
|
(a.type,
|
||||||
|
"%s/%s" % (a.src_project, a.src_package), dst)
|
||||||
|
|
||||||
desc = ""
|
|
||||||
if self.descr:
|
if self.descr:
|
||||||
desc = "\n %s" % (repr(self.descr))
|
ret += "\n Comment: %s" % (repr(self.descr))
|
||||||
|
ret += "\n"
|
||||||
|
|
||||||
return '%6d %-7s %-12s %-50s -> %-20s %s' % \
|
return ret
|
||||||
(self.reqid,
|
|
||||||
self.state.name, "(%s)" % self.state.who,
|
|
||||||
"%s/%s" % (self.actions[0].src_project, self.actions[0].src_package),
|
|
||||||
dst, desc)
|
|
||||||
|
|
||||||
def __cmp__(self, other):
|
def __cmp__(self, other):
|
||||||
return cmp(self.reqid, other.reqid)
|
return cmp(self.reqid, other.reqid)
|
||||||
@ -2159,7 +2153,7 @@ def change_request_state(apiurl, reqid, newstate, message=''):
|
|||||||
return f.read()
|
return f.read()
|
||||||
|
|
||||||
|
|
||||||
def get_request_list(apiurl, project, package, req_who='', req_state=('new',) ):
|
def get_request_list(apiurl, project, package, req_who='', req_state=('new',), req_type=None ):
|
||||||
requests = []
|
requests = []
|
||||||
|
|
||||||
matches = []
|
matches = []
|
||||||
@ -2182,6 +2176,9 @@ def get_request_list(apiurl, project, package, req_who='', req_state=('new',) ):
|
|||||||
if package:
|
if package:
|
||||||
if len(m): m += '%20and%20'
|
if len(m): m += '%20and%20'
|
||||||
m += '%s/target/@package=\'%s\'' % (what, quote_plus(package))
|
m += '%s/target/@package=\'%s\'' % (what, quote_plus(package))
|
||||||
|
if req_type:
|
||||||
|
if len(m): m += '%20and%20'
|
||||||
|
m += '%s/@type=\'%s\'' % (what, quote_plus(req_type))
|
||||||
|
|
||||||
matches.append(m)
|
matches.append(m)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user