Add cc_list to update_files method

User could attach CC addresses to the gerrit change created.

BUG=1294382
TEST=train

Change-Id: I236658d80f41b27bf007bb344934ce835cd7b5de
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3440862
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Xinan Lin <linxinan@chromium.org>
This commit is contained in:
Xinan Lin
2022-02-04 23:31:31 +00:00
committed by LUCI CQ
parent 33d87bca7e
commit 66c9784478
4 changed files with 11 additions and 3 deletions

View File

@@ -323,6 +323,7 @@ class GerritApi(recipe_api.RecipeApi):
new_contents_by_file_path,
commit_msg,
params=frozenset(['status=NEW']),
cc_list=frozenset([]),
submit=False,
submit_later=False):
"""Update a set of files by creating and submitting a Gerrit CL.
@@ -336,6 +337,7 @@ class GerritApi(recipe_api.RecipeApi):
* commit_msg: Description to add to the CL.
* params: A list of additional ChangeInput specifiers, with format
'key=value'.
* cc_list: A list of addresses to notify.
* submit: Should land this CL instantly.
* submit_later: If this change has related CLs, we may want to commit
them in a chain. So only set Bot-Commit+1, making it ready for
@@ -364,6 +366,8 @@ class GerritApi(recipe_api.RecipeApi):
]
for p in params:
command.extend(['-p', p])
for cc in cc_list:
command.extend(['--cc', cc])
step_result = self('create change at (%s %s)' % (project, branch), command)
change = int(step_result.json.output.get('_number'))
step_result.presentation.links['change %d' %