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/+/3039331
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Michael Moss <mmoss@chromium.org>
Commit-Queue: Xinan Lin <linxinan@chromium.org>
changes/31/3039331/5
Xinan Lin 4 years ago committed by LUCI CQ
parent 4e26781cf0
commit 6ec7cd87ac

@ -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."""

Loading…
Cancel
Save