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/tests/git_cl_test.py b/tests/git_cl_test.py
index 9881bd2..d3b083e 100755
--- a/tests/git_cl_test.py
+++ b/tests/git_cl_test.py
@@ -1062,16 +1062,18 @@
ref_suffix += ',m=' + title
metrics_arguments.append('m')
- calls += [
- ((['git', 'config', 'rietveld.cc'],), ''),
- ]
+ if issue is None:
+ calls += [
+ ((['git', 'config', 'rietveld.cc'],), ''),
+ ]
if short_hostname == 'chromium':
# All reviwers and ccs get into ref_suffix.
for r in sorted(reviewers):
ref_suffix += ',r=%s' % r
metrics_arguments.append('r')
- for c in sorted(['chromium-reviews+test-more-cc@chromium.org',
- 'joe@example.com'] + cc):
+ if issue is None:
+ cc += ['chromium-reviews+test-more-cc@chromium.org', 'joe@example.com']
+ for c in sorted(cc):
ref_suffix += ',cc=%s' % c
metrics_arguments.append('cc')
reviewers, cc = [], []
@@ -1091,7 +1093,9 @@
ref_suffix += ',r=%s' % r
metrics_arguments.append('r')
reviewers.remove(r)
- for c in sorted(['joe@example.com'] + cc):
+ if issue is None:
+ cc += ['joe@example.com']
+ for c in sorted(cc):
ref_suffix += ',cc=%s' % c
metrics_arguments.append('cc')
if c in cc: