|
@@ -19,6 +19,7 @@
|
|
# MA 02111-1307 USA
|
|
# MA 02111-1307 USA
|
|
#
|
|
#
|
|
|
|
|
|
|
|
+import itertools
|
|
import os
|
|
import os
|
|
|
|
|
|
import gitutil
|
|
import gitutil
|
|
@@ -138,6 +139,9 @@ class Series(dict):
|
|
print 'Prefix:\t ', self.get('prefix')
|
|
print 'Prefix:\t ', self.get('prefix')
|
|
if self.cover:
|
|
if self.cover:
|
|
print 'Cover: %d lines' % len(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:
|
|
if cmd:
|
|
print 'Git command: %s' % cmd
|
|
print 'Git command: %s' % cmd
|
|
|
|
|
|
@@ -201,27 +205,33 @@ class Series(dict):
|
|
str = 'Change log exists, but no version is set'
|
|
str = 'Change log exists, but no version is set'
|
|
print col.Color(col.RED, str)
|
|
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
|
|
"""Make a cc file for us to use for per-commit Cc automation
|
|
|
|
|
|
Also stores in self._generated_cc to make ShowActions() faster.
|
|
Also stores in self._generated_cc to make ShowActions() faster.
|
|
|
|
|
|
Args:
|
|
Args:
|
|
process_tags: Process tags as if they were aliases
|
|
process_tags: Process tags as if they were aliases
|
|
|
|
+ cover_fname: If non-None the name of the cover letter.
|
|
Return:
|
|
Return:
|
|
Filename of temp file created
|
|
Filename of temp file created
|
|
"""
|
|
"""
|
|
# Look for commit tags (of the form 'xxx:' at the start of the subject)
|
|
# Look for commit tags (of the form 'xxx:' at the start of the subject)
|
|
fname = '/tmp/patman.%d' % os.getpid()
|
|
fname = '/tmp/patman.%d' % os.getpid()
|
|
fd = open(fname, 'w')
|
|
fd = open(fname, 'w')
|
|
|
|
+ all_ccs = []
|
|
for commit in self.commits:
|
|
for commit in self.commits:
|
|
list = []
|
|
list = []
|
|
if process_tags:
|
|
if process_tags:
|
|
list += gitutil.BuildEmailList(commit.tags)
|
|
list += gitutil.BuildEmailList(commit.tags)
|
|
list += gitutil.BuildEmailList(commit.cc_list)
|
|
list += gitutil.BuildEmailList(commit.cc_list)
|
|
|
|
+ all_ccs += list
|
|
print >>fd, commit.patch, ', '.join(list)
|
|
print >>fd, commit.patch, ', '.join(list)
|
|
self._generated_cc[commit.patch] = list
|
|
self._generated_cc[commit.patch] = list
|
|
|
|
|
|
|
|
+ if cover_fname:
|
|
|
|
+ print >>fd, cover_fname, ', '.join(set(all_ccs))
|
|
|
|
+
|
|
fd.close()
|
|
fd.close()
|
|
return fname
|
|
return fname
|
|
|
|
|