From a4ceaa1e5a555d27bfea40811c209640fa248392 Mon Sep 17 00:00:00 2001 From: Ravi Mistry Date: Thu, 7 Dec 2017 14:46:40 -0500 Subject: [PATCH] [Infra] Add ability to specify a cc_list to git_utils.py Bug: skia:7310 Change-Id: I8ef505025e2cf0b7859e54e85293efed16704398 Reviewed-on: https://skia-review.googlesource.com/82200 Commit-Queue: Ravi Mistry Reviewed-by: Eric Boren --- infra/bots/git_utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/infra/bots/git_utils.py b/infra/bots/git_utils.py index 5e1d0c9537..8e623f7887 100644 --- a/infra/bots/git_utils.py +++ b/infra/bots/git_utils.py @@ -47,13 +47,14 @@ class GitBranch(object): created temporary branch upon exit. """ def __init__(self, branch_name, commit_msg, upload=True, commit_queue=False, - delete_when_finished=True): + delete_when_finished=True, cc_list=None): self._branch_name = branch_name self._commit_msg = commit_msg self._upload = upload self._commit_queue = commit_queue self._patch_set = 0 self._delete_when_finished = delete_when_finished + self._cc_list = cc_list def __enter__(self): subprocess.check_call(['git', 'reset', '--hard', 'HEAD']) @@ -76,6 +77,8 @@ class GitBranch(object): upload_cmd.append('--use-commit-queue') # Need the --send-mail flag to publish the CL and remove WIP bit. upload_cmd.append('--send-mail') + if self._cc_list: + upload_cmd.extend(['--cc=%s' % ','.join(self._cc_list)]) subprocess.check_call(upload_cmd) output = subprocess.check_output(['git', 'cl', 'issue']).rstrip() return re.match('^Issue number: (?P\d+) \((?P.+)\)$',