Commit 6ec7cd87 authored by Xinan Lin's avatar Xinan Lin Committed by LUCI CQ

Add CMDsubmitchange to gerrit_client

Grant the power to gerrit_client cmd to submit a change. Once
we create a change and update it via CMDchangeedit, we can
submit it if the service account has permission.

BUG=1207955
TEST=e2e

Change-Id: Ia3102641ffe5bb72f8f63ad80bf15b5478cf5a2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3039331Reviewed-by: 's avatarDirk Pranke <dpranke@google.com>
Reviewed-by: 's avatarMichael Moss <mmoss@chromium.org>
Commit-Queue: Xinan Lin <linxinan@chromium.org>
parent 4e26781c
......@@ -237,6 +237,23 @@ def CMDpublishchangeedit(parser, args):
write_result(result, opt)
@subcommand.usage('[args ...]')
def CMDsubmitchange(parser, args):
"""Submit a Gerrit change."""
parser.add_option('-c', '--change', type=int, help='change number')
parser.add_option('--wait-for-merge',
action="store_true",
default=False,
help='whether to wait for the merge')
(opt, args) = parser.parse_args(args)
result = gerrit_util.SubmitChange(urlparse.urlparse(opt.host).netloc,
opt.change,
wait_for_merge=opt.wait_for_merge)
logging.info(result)
write_result(result, opt)
@subcommand.usage('')
def CMDabandon(parser, args):
"""Abandons a Gerrit change."""
......
Markdown is supported
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