Commit 2b4ec955 authored by Xinan Lin's avatar Xinan Lin Committed by LUCI CQ

Add new subcommand for 'Changes Submitted Together'.

We may need to submit a chain of CLs. With this sub-cmd, we could
track their revisions along the chain, without querying them one
by one.

BUG=1236658
TEST=local run

Change-Id: If5930fb8f01daccff4d7c5c5e91c8db8887d8e47
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3098095Reviewed-by: 's avatarDirk Pranke <dpranke@google.com>
Reviewed-by: 's avatarMichael Moss <mmoss@chromium.org>
Commit-Queue: Xinan Lin <linxinan@chromium.org>
parent 1b1e7f1e
......@@ -248,6 +248,17 @@ def CMDsubmitchange(parser, args):
write_result(result, opt)
@subcommand.usage('[args ...]')
def CMDchangesubmittedtogether(parser, args):
"""Get all changes submitted with the given one."""
parser.add_option('-c', '--change', type=int, help='change number')
(opt, args) = parser.parse_args(args)
result = gerrit_util.GetChangesSubmittedTogether(
urlparse.urlparse(opt.host).netloc, opt.change)
logging.info(result)
write_result(result, opt)
@subcommand.usage('[args ...]')
def CMDgetcommitincludedin(parser, args):
"""Retrieves the branches and tags for a given commit."""
......
......@@ -743,6 +743,13 @@ def SubmitChange(host, change):
return ReadHttpJsonResponse(conn)
def GetChangesSubmittedTogether(host, change):
"""Get all changes submitted with the given one."""
path = 'changes/%s/submitted_together?o=NON_VISIBLE_CHANGES' % change
conn = CreateHttpConn(host, path, reqtype='GET')
return ReadHttpJsonResponse(conn)
def PublishChangeEdit(host, change, notify=True):
"""Publish a Gerrit change edit."""
path = 'changes/%s/edit:publish' % 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