From 313ef5f897f15bc7ec2ca8054f4e4871a2f6be93 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 29 Oct 2020 21:46:24 -0600 Subject: 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 --- tools/patman/commit.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tools/patman/commit.py') diff --git a/tools/patman/commit.py b/tools/patman/commit.py index 8d583c4ed3..e49bf87dfc 100644 --- a/tools/patman/commit.py +++ b/tools/patman/commit.py @@ -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. -- cgit v1.2.1 From a12ad7c94064759f5be02b879f3f52ed5111335f Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 29 Oct 2020 21:46:32 -0600 Subject: patman: Allow showing a Commit as a string Use the subject of the Commit object when printing it out. Signed-off-by: Simon Glass --- tools/patman/commit.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tools/patman/commit.py') diff --git a/tools/patman/commit.py b/tools/patman/commit.py index e49bf87dfc..5bf2b94029 100644 --- a/tools/patman/commit.py +++ b/tools/patman/commit.py @@ -41,6 +41,9 @@ class Commit: self.rtags = collections.defaultdict(set) self.warn = [] + def __str__(self): + return self.subject + def AddChange(self, version, info): """Add a new change line to the change list for a version. -- cgit v1.2.1