diff --git a/NEWS b/NEWS index f2c323ba..61792342 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ - branch --add-repositories can be used to add repos from source project to target project - branch --extend-package-names can be used to do mbranch like branch of a single package - branch --new-package can be used to do branch from a not yet existing package (to define later submit target) + - show declined requests which created by user 0.132 - rdelete and undelete command requesting now a comment diff --git a/osc/commandline.py b/osc/commandline.py index a3f74831..8807e870 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -5691,6 +5691,22 @@ Please submit there instead, or use --nodevelproject to force direct submission. # try api side search as supported since OBS 2.2 try: requests = [] + # declined requests submitted by me + u = makeurl(apiurl, ['request'], { + 'view' : 'collection', + 'states': 'declined', + 'roles': 'creator', + 'user' : user, + }) + f = http_GET(u) + root = ET.parse(f).getroot() + if root.findall('request'): + print "Declined requests created by you (revoke, reopen or supersede):\n" + for node in root.findall('request'): + r = Request() + r.read(node) + print r.list_view(), '\n' + print "" # open reviews u = makeurl(apiurl, ['request'], { 'view' : 'collection', @@ -5701,10 +5717,13 @@ Please submit there instead, or use --nodevelproject to force direct submission. }) f = http_GET(u) root = ET.parse(f).getroot() - for node in root.findall('request'): - r = Request() - r.read(node) - requests.append(r) + if root.findall('request'): + print "Requests which request a review by you:\n" + for node in root.findall('request'): + r = Request() + r.read(node) + print r.list_view(), '\n' + print "" # open requests u = makeurl(apiurl, ['request'], { 'view' : 'collection', @@ -5714,12 +5733,13 @@ Please submit there instead, or use --nodevelproject to force direct submission. }) f = http_GET(u) root = ET.parse(f).getroot() - for node in root.findall('request'): - r = Request() - r.read(node) - requests.append(r) - for r in sorted(requests): - print r.list_view(), '\n' + if root.findall('request'): + print "Requests for your packages:\n" + for node in root.findall('request'): + r = Request() + r.read(node) + print r.list_view(), '\n' + print "" return except urllib2.HTTPError, e: if e.code == 400: