1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-26 20:22:13 +01:00

- fixes for the last commit (r4684), actually only the change in core.py was intended.

now 'osc submitrequest create' checks if you already submitted requests for this package, if so it'll ask you if the previous submissions should be revoked
This commit is contained in:
Marcus Hüwe 2008-08-17 19:10:44 +00:00
parent f4e4c91376
commit fc0d61bfce

View File

@ -563,13 +563,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
% (devloc, dst_package) % (devloc, dst_package)
sys.exit(1) sys.exit(1)
reqs = get_submit_request_list(apiurl, dst_project, dst_package) reqs = get_submit_request_list(apiurl, dst_project, dst_package)
oreqs = [] user = conf.get_apiurl_usr(apiurl)
myreqs = [] myreqs = [ i for i in reqs if i.state.who == user ]
for req in reqs:
if req.state.who == conf.get_apiurl_usr(apiurl):
myreqs.append(req)
else:
oreqs.append(req)
if len(myreqs) > 0: if len(myreqs) > 0:
print 'You already created the following submitrequests: %s.' % \ print 'You already created the following submitrequests: %s.' % \
', '.join([str(i.reqid) for i in myreqs ]) ', '.join([str(i.reqid) for i in myreqs ])
@ -577,7 +572,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
if repl == 'y': if repl == 'y':
for req in myreqs: for req in myreqs:
change_submit_request_state(apiurl, str(req.reqid), 'revoked', change_submit_request_state(apiurl, str(req.reqid), 'revoked',
'obsoleted by request: %s' % req.reqid) 'obsoleted by another request')
result = create_submit_request(apiurl, result = create_submit_request(apiurl,
src_project, src_package, src_project, src_package,