diff options
author | Simon Glass | 2020-07-05 21:41:57 -0600 |
---|---|---|
committer | Simon Glass | 2020-07-20 11:37:47 -0600 |
commit | df3fc0757b77dea408a8253bc801573ef19606f2 (patch) | |
tree | dbf502d4110a5a19710bc4627e4ff413aac2f741 /tools/patman/commit.py | |
parent | ef6629128c2d58cbd2c9a2a88e5857842c73f782 (diff) |
patman: Support collecting response tags in Patchstream
Collect response tags such as 'Reviewed-by' while parsing the stream.
This allows us to see what tags are present.
Add a new 'Fixes' tag also, since this is now quite common.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman/commit.py')
-rw-r--r-- | tools/patman/commit.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/patman/commit.py b/tools/patman/commit.py index 48d0529c536..8d583c4ed39 100644 --- a/tools/patman/commit.py +++ b/tools/patman/commit.py @@ -2,6 +2,7 @@ # Copyright (c) 2011 The Chromium OS Authors. # +import collections import re # Separates a tag: at the beginning of the subject from the rest of it @@ -23,6 +24,9 @@ class Commit: notes: List of lines in the commit (not series) notes change_id: the Change-Id: tag that was stripped from this commit and can be used to generate the Message-Id. + rtags: Response tags (e.g. Reviewed-by) collected by the commit, dict: + key: rtag type (e.g. 'Reviewed-by') + value: Set of people who gave that rtag, each a name/email string """ def __init__(self, hash): self.hash = hash @@ -33,6 +37,7 @@ class Commit: self.signoff_set = set() self.notes = [] self.change_id = None + self.rtags = collections.defaultdict(set) def AddChange(self, version, info): """Add a new change line to the change list for a version. @@ -88,3 +93,12 @@ class Commit: return False self.signoff_set.add(signoff) return True + + def AddRtag(self, rtag_type, who): + """Add a response tag to a commit + + Args: + key: rtag type (e.g. 'Reviewed-by') + who: Person who gave that rtag, e.g. 'Fred Bloggs <fred@bloggs.org>' + """ + self.rtags[rtag_type].add(who) |