mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
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/+/3098095 Reviewed-by: Dirk Pranke <dpranke@google.com> Reviewed-by: Michael Moss <mmoss@chromium.org> Commit-Queue: Xinan Lin <linxinan@chromium.org>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user