Commit f6d2d016 authored by Lorenz Huedepohl's avatar Lorenz Huedepohl
Browse files

Make mpcdf_push work also when no sources have been changed

parent 69200527
......@@ -88,16 +88,27 @@ def do_mpcdf_push(self, subcmd, opts, *args):
"Configure the enabled repositories first, with `osc mpcdf_enable_repositories`", file=sys.stderr)
raise SystemExit(1)
req_id = osc.core.create_submit_request(api_url, from_project, package, dst_project=to_project,
message="Update {0} from {1}".format(package, from_project) if not opts.message else opts.message)
print("Submitted package {0} to {1} in request {2}".format(package, to_project, req_id))
if not opts.batch:
print("\nPLEASE review the request by 'osc request show {0} --diff', or in the web interface\n".format(req_id))
print("Press Ctrl-C to abort, any key to continue", end="")
input()
result = osc.core.change_request_state(api_url, req_id, 'accepted', "Accepted on the command line via 'osc mpcdf_push'")
print(" Accepting request {0}:".format(req_id), result)
req_id = None
try:
req_id = osc.core.create_submit_request(api_url, from_project, package, dst_project=to_project,
message="Update {0} from {1}".format(package, from_project) if not opts.message else opts.message)
except osc.core.HTTPError as e:
if e.code == 400:
if "The request contains no actions" in e.read():
print("No source changes found, submit request not necessary")
else:
raise e
if req_id:
print("Submitted package {0} to {1} in request {2}".format(package, to_project, req_id))
if not opts.batch:
print("\nPLEASE review the request by 'osc request show {0} --diff', or in the web interface\n".format(req_id))
print("Press Ctrl-C to abort, any key to continue", end="")
input()
result = osc.core.change_request_state(api_url, req_id, 'accepted', "Accepted on the command line via 'osc mpcdf_push'")
print(" Accepting request {0}:".format(req_id), result)
if not opts.batch:
user = osc.conf.get_apiurl_usr(api_url)
if user not in existing_maintainers:
print("Adding you to the list of maintainers for this package")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment