[U-Boot] patman: Do not Cc addresses included in To list

Message ID 1345310096-20460-1-git-send-email-otavio@ossystems.com.br
State Accepted
Delegated to: Wolfgang Denk
Headers show

Commit Message

Otavio Salvador Aug. 18, 2012, 5:14 p.m.
In case an address is listed in the To list, those will be skipped on
Cc list or user might end with a duplicated message.

This fixes the case when a tag points to same address used as series
destination thus avoiding duplicated sending.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Changes in v2:
- use if 'to' in self: to remove the try block

 tools/patman/series.py |    4 ++++
 1 file changed, 4 insertions(+)


diff --git a/tools/patman/series.py b/tools/patman/series.py
index eda1e9b..663990b 100644
--- a/tools/patman/series.py
+++ b/tools/patman/series.py
@@ -114,6 +114,10 @@  class Series(dict):
                 cc_list += gitutil.BuildEmailList(commit.tags)
             cc_list += gitutil.BuildEmailList(commit.cc_list)
+            # Skip items in To list
+            if 'to' in self:
+                map(cc_list.remove, gitutil.BuildEmailList(self.to))
             for email in cc_list:
                 if email == None:
                     email = col.Color(col.YELLOW, "<alias '%s' not found>"