Only add a CC if it is not already present in the list of CCs.

For reasons unknown, the presubmit seems to make multiple passes
sometimes; this sometimes results in an email address being inserted
into the list of additional CCs multiple times. While this is de-duped
by Gerrit, it still generates a fairly spammy message on the client
side.

Change-Id: I38688462d02ff17f3765c91af326161107027351
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3957428
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
changes/28/3957428/2
Daniel Cheng 3 years ago committed by LUCI CQ
parent c484e25ca0
commit 0e9f668e4d

@ -541,7 +541,8 @@ class OutputApi(object):
def AppendCC(self, cc):
"""Appends a user to cc for this change."""
self.more_cc.append(cc)
if cc not in self.more_cc:
self.more_cc.append(cc)
def PresubmitPromptOrNotify(self, *args, **kwargs):
"""Warn the user when uploading, but only notify if committing."""

Loading…
Cancel
Save