summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Anderson <dianders@chromium.org>2012-12-03 14:40:43 +0000
committerSimon Glass <sjg@chromium.org>2013-01-31 15:23:39 -0800
commit311872551570a6439f62ab476c6fd4836a7a9aa7 (patch)
treea65bc3655ce44d3023580677ca3dcdfc23e65793
parentd94566a1115d35f87db793d2daaa79823528937c (diff)
downloadu-boot-imx-311872551570a6439f62ab476c6fd4836a7a9aa7.zip
u-boot-imx-311872551570a6439f62ab476c6fd4836a7a9aa7.tar.gz
u-boot-imx-311872551570a6439f62ab476c6fd4836a7a9aa7.tar.bz2
patman: Add all CC addresses to the cover letter
If we're sending a cover letter make sure to CC everyone that we're CCing on each of the individual patches. Signed-off-by: Doug Anderson <dianders@chromium.org>
-rw-r--r--tools/patman/README3
-rwxr-xr-xtools/patman/patman.py2
-rw-r--r--tools/patman/series.py12
3 files changed, 15 insertions, 2 deletions
diff --git a/tools/patman/README b/tools/patman/README
index dc3957c..5b6eba0 100644
--- a/tools/patman/README
+++ b/tools/patman/README
@@ -226,6 +226,9 @@ Date: Mon Nov 7 23:18:44 2011 -0500
will create a patch which is copied to x86, arm, sandbox, mikef, ag and
afleming.
+If you have a cover letter it will get sent to the union of the CC lists of
+all of the other patches.
+
Example Work Flow
=================
diff --git a/tools/patman/patman.py b/tools/patman/patman.py
index de8314a..4181d80 100755
--- a/tools/patman/patman.py
+++ b/tools/patman/patman.py
@@ -140,7 +140,7 @@ else:
options.count + options.start):
ok = False
- cc_file = series.MakeCcFile(options.process_tags)
+ cc_file = series.MakeCcFile(options.process_tags, cover_fname)
# Email the patches out (giving the user time to check / cancel)
cmd = ''
diff --git a/tools/patman/series.py b/tools/patman/series.py
index ad8288d..083af0f 100644
--- a/tools/patman/series.py
+++ b/tools/patman/series.py
@@ -19,6 +19,7 @@
# MA 02111-1307 USA
#
+import itertools
import os
import gitutil
@@ -138,6 +139,9 @@ class Series(dict):
print 'Prefix:\t ', self.get('prefix')
if self.cover:
print 'Cover: %d lines' % len(self.cover)
+ all_ccs = itertools.chain(*self._generated_cc.values())
+ for email in set(all_ccs):
+ print ' Cc: ',email
if cmd:
print 'Git command: %s' % cmd
@@ -201,27 +205,33 @@ class Series(dict):
str = 'Change log exists, but no version is set'
print col.Color(col.RED, str)
- def MakeCcFile(self, process_tags):
+ def MakeCcFile(self, process_tags, cover_fname):
"""Make a cc file for us to use for per-commit Cc automation
Also stores in self._generated_cc to make ShowActions() faster.
Args:
process_tags: Process tags as if they were aliases
+ cover_fname: If non-None the name of the cover letter.
Return:
Filename of temp file created
"""
# Look for commit tags (of the form 'xxx:' at the start of the subject)
fname = '/tmp/patman.%d' % os.getpid()
fd = open(fname, 'w')
+ all_ccs = []
for commit in self.commits:
list = []
if process_tags:
list += gitutil.BuildEmailList(commit.tags)
list += gitutil.BuildEmailList(commit.cc_list)
+ all_ccs += list
print >>fd, commit.patch, ', '.join(list)
self._generated_cc[commit.patch] = list
+ if cover_fname:
+ print >>fd, cover_fname, ', '.join(set(all_ccs))
+
fd.close()
return fname