From 072d06e918529cbcd9aac4557e6324c3c8ec7a27 Mon Sep 17 00:00:00 2001 From: Anne Redulla Date: Thu, 6 Jul 2023 23:12:16 +0000 Subject: [PATCH] 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 Commit-Queue: Anne Redulla --- git_cl.py | 15 ++++++++++++--- split_cl.py | 6 ++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/git_cl.py b/git_cl.py index d2575f5417..41bdd7e21d 100755 --- a/git_cl.py +++ b/git_cl.py @@ -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, diff --git a/split_cl.py b/split_cl.py index 0ff1e72add..377df69c91 100644 --- a/split_cl.py +++ b/split_cl.py @@ -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,