]> git.sur5r.net Git - u-boot/blobdiff - tools/patman/series.py
Merge git://git.denx.de/u-boot-dm
[u-boot] / tools / patman / series.py
index d3947a7c2ac5ce7ac09793777ccea681f84c88a6..2735afaf88feab0eb3e4546dac7912f088fe37bc 100644 (file)
@@ -1,7 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0+
 # Copyright (c) 2011 The Chromium OS Authors.
 #
-# SPDX-License-Identifier:     GPL-2.0+
-#
 
 from __future__ import print_function
 
@@ -10,6 +9,7 @@ import os
 
 import get_maintainer
 import gitutil
+import settings
 import terminal
 
 # Series-xxx tags that we understand
@@ -202,7 +202,7 @@ class Series(dict):
             print(col.Color(col.RED, str))
 
     def MakeCcFile(self, process_tags, cover_fname, raise_on_error,
-                   add_maintainers):
+                   add_maintainers, limit):
         """Make a cc file for us to use for per-commit Cc automation
 
         Also stores in self._generated_cc to make ShowActions() faster.
@@ -215,9 +215,11 @@ class Series(dict):
             add_maintainers: Either:
                 True/False to call the get_maintainers to CC maintainers
                 List of maintainers to include (for testing)
+            limit: Limit the length of the Cc list
         Return:
             Filename of temp file created
         """
+        col = terminal.Color()
         # Look for commit tags (of the form 'xxx:' at the start of the subject)
         fname = '/tmp/patman.%d' % os.getpid()
         fd = open(fname, 'w')
@@ -233,7 +235,12 @@ class Series(dict):
                 cc += add_maintainers
             elif add_maintainers:
                 cc += get_maintainer.GetMaintainer(commit.patch)
+            for x in set(cc) & set(settings.bounces):
+                print(col.Color(col.YELLOW, 'Skipping "%s"' % x))
+            cc = set(cc) - set(settings.bounces)
             cc = [m.encode('utf-8') if type(m) != str else m for m in cc]
+            if limit is not None:
+                cc = cc[:limit]
             all_ccs += cc
             print(commit.patch, ', '.join(set(cc)), file=fd)
             self._generated_cc[commit.patch] = cc