Created disable-auto-submit flag for git cl split

This CL adds a disable-auto-submit flag for git cl split.

Change-Id: Ibce0e06706390ff9429d59094fed2449096c631c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4659527
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Anne Redulla <aredulla@google.com>
changes/27/4659527/5
Anne Redulla 2 years ago committed by LUCI CQ
parent b6eaed26fc
commit 072d06e918

@ -5123,11 +5123,20 @@ def CMDsplit(parser, args):
'infrastructure. Try to upload these not during high '
'load times (usually 11-3 Mountain View time). Email '
'infra-dev@chromium.org with any questions.')
parser.add_option('-a', '--enable-auto-submit', action='store_true',
parser.add_option('-a',
'--enable-auto-submit',
action='store_true',
dest='enable_auto_submit',
default=True,
help='Sends your change to the CQ after an approval. Only '
'works on repos that have the Auto-Submit label '
'enabled')
'works on repos that have the Auto-Submit label '
'enabled')
parser.add_option('--disable-auto-submit',
action='store_false',
dest='enable_auto_submit',
help='Disables automatic sending of the changes to the CQ '
'after approval. Note that auto-submit only works for '
'repos that have the Auto-Submit label enabled.')
parser.add_option('--max-depth',
type='int',
default=0,

@ -168,7 +168,7 @@ def GetFilesSplitByOwners(files, max_depth):
def PrintClInfo(cl_index, num_cls, directory, file_paths, description,
reviewers, topic):
reviewers, enable_auto_submit, topic):
"""Prints info about a CL.
Args:
@ -179,6 +179,7 @@ def PrintClInfo(cl_index, num_cls, directory, file_paths, description,
file_paths: A list of files in this CL.
description: The CL description.
reviewers: A set of reviewers for this CL.
enable_auto_submit: If the CL should also have auto submit enabled.
topic: Topic to set for this CL.
"""
description_lines = FormatDescriptionOrComment(description,
@ -188,6 +189,7 @@ def PrintClInfo(cl_index, num_cls, directory, file_paths, description,
print('CL {}/{}'.format(cl_index, num_cls))
print('Path: {}'.format(directory))
print('Reviewers: {}'.format(', '.join(reviewers)))
print('Auto-Submit: {}'.format(enable_auto_submit))
print('Topic: {}'.format(topic))
print('\n' + indented_description + '\n')
print('\n'.join(file_paths))
@ -276,7 +278,7 @@ def SplitCl(description_file, comment_file, changelist, cmd_upload, dry_run,
file_paths, exclude=[author, cl.owners_client.EVERYONE])
if dry_run:
PrintClInfo(cl_index, num_cls, directory, file_paths, description,
reviewers, topic)
reviewers, enable_auto_submit, topic)
else:
UploadCl(refactor_branch, refactor_branch_upstream, directory, files,
description, comment, reviewers, changelist, cmd_upload,

Loading…
Cancel
Save