From a73711ad65e0f5d9ad155713fea2e609cd7fc188 Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Fri, 22 May 2020 17:55:05 -0400 Subject: Add ability to diff arbitrary mbox files Sometimes we are unable to properly look up previous series -- usually because the cover letter title changes. For those cases, it is now possible to diff two arbitrary mbox files prepared with "b4 am -T". There's also a smattering of other fixes in there because I'm too lazy to properly stage my patches. Signed-off-by: Konstantin Ryabitsev --- b4/__init__.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'b4/__init__.py') diff --git a/b4/__init__.py b/b4/__init__.py index 414f669..b6f25fe 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -335,19 +335,19 @@ class LoreMailbox: logger.debug('Looking at: %s', lmsg.full_subject) self.msgid_map[lmsg.msgid] = lmsg - if lmsg.counter == 0 and lmsg.has_diffstat: - # Cover letter - # Add it to covers -- we'll deal with them later - logger.debug(' adding as v%s cover letter', lmsg.revision) - self.covers[lmsg.revision] = lmsg - return - if lmsg.reply: # We'll figure out where this belongs later logger.debug(' adding to followups') self.followups.append(lmsg) return + if lmsg.counter == 0 and (not lmsg.counters_inferred or lmsg.has_diffstat): + # Cover letter + # Add it to covers -- we'll deal with them later + logger.debug(' adding as v%s cover letter', lmsg.revision) + self.covers[lmsg.revision] = lmsg + return + if re.search(r'^Comment: att-fmt-ver:', lmsg.body, re.I | re.M): logger.debug('Found attestation message') LoreAttestationDocument.load_from_string(lmsg.msgid, lmsg.body) -- cgit v1.2.3