patman: Attach warnings to individual patches

At present warnings are produced across the whole set of patches when
parsing them. It is more useful to associate each warning with the patch
(or commit) that generated it.

Attach warnings to the Commit object and move them out of PatchStream.
Also avoid generating duplicate warnings for the same commit.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2020-10-29 21:46:24 -06:00
parent b5cc399053
commit 313ef5f897
2 changed files with 13 additions and 4 deletions

View file

@ -27,6 +27,7 @@ class Commit:
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
warn: List of warnings for this commit, each a str
"""
def __init__(self, hash):
self.hash = hash
@ -38,6 +39,7 @@ class Commit:
self.notes = []
self.change_id = None
self.rtags = collections.defaultdict(set)
self.warn = []
def AddChange(self, version, info):
"""Add a new change line to the change list for a version.