git-cl: Set CC from watchlists only on first upload
This will prevent moving reviewers to cc when uploading patches.
Bug: 1010499
Change-Id: Ida16a4686f46350ba009bdaec1542895208c3f2d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1835016
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
diff --git a/git_cl.py b/git_cl.py
index a85226f..30088cc 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -2540,11 +2540,12 @@
options.add_owners_to, change)
reviewers = sorted(change_desc.get_reviewers())
- # Add cc's from the CC_LIST and --cc flag (if any).
- if not options.private and not options.no_autocc:
+ cc = []
+ # Add CCs from WATCHLISTS and rietveld.cc git config unless this is
+ # the initial upload, the CL is private, or auto-CCing has ben disabled.
+ if not (self.GetIssue() or options.private or options.no_autocc):
cc = self.GetCCList().split(',')
- else:
- cc = []
+ # Add cc's from the --cc flag.
if options.cc:
cc.extend(options.cc)
cc = filter(None, [email.strip() for email in cc])