diff --git a/osc/commandline.py b/osc/commandline.py index b673a13b..f959dcc0 100755 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -562,6 +562,22 @@ of the package %s primarily takes place. Please submit there instead, or use --nodevelproject to force direct submission.""" \ % (devloc, dst_package) sys.exit(1) + reqs = get_submit_request_list(apiurl, dst_project, dst_package) + oreqs = [] + myreqs = [] + for req in reqs: + if req.state.who == conf.get_apiurl_usr(apiurl): + myreqs.append(req) + else: + oreqs.append(req) + if len(myreqs) > 0: + print 'You already created the following submitrequests: %s.' % \ + ', '.join([str(i.reqid) for i in myreqs ]) + repl = raw_input('Revoke the old requests? (y/N) ') + if repl == 'y': + for req in myreqs: + change_submit_request_state(apiurl, str(req.reqid), 'revoked', + 'obsoleted by request: %s' % req.reqid) result = create_submit_request(apiurl, src_project, src_package, diff --git a/osc/core.py b/osc/core.py index 53f27cc2..52850571 100755 --- a/osc/core.py +++ b/osc/core.py @@ -1958,7 +1958,7 @@ def get_submit_request_list(apiurl, project, package, req_state=('new')): for root in collection.findall('request'): r = SubmitReq() r.read(root) - if (r.state.name in req_state) or ('' in req_state): + if (r.state.name in req_state) or not len(req_state): requests.append(r) return requests