Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(747)

Unified Diff: git_cl.py

Issue 24257014: Ignore CC_LIST when private flag is specified. (Closed) Base URL: http://src.chromium.org/svn/trunk/tools/depot_tools/
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gcl.py ('k') | tests/git_cl_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
===================================================================
--- git_cl.py (revision 225130)
+++ git_cl.py (working copy)
@@ -442,11 +442,17 @@
Return is a string suitable for passing to gcl with the --cc flag.
"""
if self.cc is None:
- base_cc = settings .GetDefaultCCList()
+ base_cc = settings.GetDefaultCCList()
more_cc = ','.join(self.watchers)
self.cc = ','.join(filter(None, (base_cc, more_cc))) or ''
return self.cc
+ def GetCCListWithoutDefault(self):
+ """Return the users cc'd on this CL excluding default ones."""
+ if self.cc is None:
+ self.cc = ','.join(self.watchers)
+ return self.cc
+
def SetWatchers(self, watchers):
"""Set the list of email addresses that should be cc'd based on the changed
files in this CL.
@@ -1421,7 +1427,18 @@
if not change_desc.get_reviewers():
DieWithError("Must specify reviewers to send email.")
upload_args.append('--send_mail')
- cc = ','.join(filter(None, (cl.GetCCList(), ','.join(options.cc))))
+
+ # We check this before applying rietveld.private assuming that in
+ # rietveld.cc only addresses which we can send private CLs to are listed
+ # if rietveld.private is set, and so we should ignore rietveld.cc only when
+ # --private is specified explicitly on the command line.
+ if options.private:
+ logging.warn('rietveld.cc is ignored since private flag is specified. '
+ 'You need to review and add them manually if necessary.')
+ cc = cl.GetCCListWithoutDefault()
+ else:
+ cc = cl.GetCCList()
+ cc = ','.join(filter(None, (cc, ','.join(options.cc))))
if cc:
upload_args.extend(['--cc', cc])
« no previous file with comments | « gcl.py ('k') | tests/git_cl_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698