aboutsummaryrefslogtreecommitdiff
path: root/tools/patman/series.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-05-14 15:53:51 -0600
committerSimon Glass <sjg@chromium.org>2019-07-10 16:52:58 -0600
commitb644c66f693c82750077b6f7530dde79f2ad7523 (patch)
treed061c65cc7ba8f4a3c764c05052529dc21fe2be1 /tools/patman/series.py
parent513eace47d63161cabfd3cce82f3e075525b164a (diff)
downloadu-boot-b644c66f693c82750077b6f7530dde79f2ad7523.zip
u-boot-b644c66f693c82750077b6f7530dde79f2ad7523.tar.gz
u-boot-b644c66f693c82750077b6f7530dde79f2ad7523.tar.bz2
patman: Sort series output for repeatabily
We use sets to produce the list of To and Cc lines for a series. This does not result in stable ordering of the recipients. Sort each list to ensure that the output is repeatable. This is necessary for tests. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman/series.py')
-rw-r--r--tools/patman/series.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/patman/series.py b/tools/patman/series.py
index 0b71a89..bbb30d8 100644
--- a/tools/patman/series.py
+++ b/tools/patman/series.py
@@ -115,16 +115,16 @@ class Series(dict):
commit = self.commits[upto]
print(col.Color(col.GREEN, ' %s' % args[upto]))
cc_list = list(self._generated_cc[commit.patch])
- for email in set(cc_list) - to_set - cc_set:
+ for email in sorted(set(cc_list) - to_set - cc_set):
if email == None:
email = col.Color(col.YELLOW, "<alias '%s' not found>"
% tag)
if email:
print(' Cc: ', email)
print
- for item in to_set:
+ for item in sorted(to_set):
print('To:\t ', item)
- for item in cc_set - to_set:
+ for item in sorted(cc_set - to_set):
print('Cc:\t ', item)
print('Version: ', self.get('version'))
print('Prefix:\t ', self.get('prefix'))
@@ -132,7 +132,7 @@ class Series(dict):
print('Cover: %d lines' % len(self.cover))
cover_cc = gitutil.BuildEmailList(self.get('cover_cc', ''))
all_ccs = itertools.chain(cover_cc, *self._generated_cc.values())
- for email in set(all_ccs) - to_set - cc_set:
+ for email in sorted(set(all_ccs) - to_set - cc_set):
print(' Cc: ', email)
if cmd:
print('Git command: %s' % cmd)
@@ -243,7 +243,7 @@ class Series(dict):
if limit is not None:
cc = cc[:limit]
all_ccs += cc
- print(commit.patch, ', '.join(set(cc)), file=fd)
+ print(commit.patch, ', '.join(sorted(set(cc))), file=fd)
self._generated_cc[commit.patch] = cc
if cover_fname:
@@ -251,7 +251,7 @@ class Series(dict):
cover_cc = [m.encode('utf-8') if type(m) != str else m
for m in cover_cc]
cc_list = ', '.join([tools.ToUnicode(x)
- for x in set(cover_cc + all_ccs)])
+ for x in sorted(set(cover_cc + all_ccs))])
print(cover_fname, cc_list.encode('utf-8'), file=fd)
fd.close()