From 7a20dcf82257604586b29642d078194447d492b7 Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Fri, 21 May 2021 10:05:43 -0400 Subject: Warn when we find an "Obsoleted-by" trailer If we come across an obsoleted-by trailer, and we're not running with --checknewer, then output a warning that there is a newer revision. Signed-off-by: Konstantin Ryabitsev --- b4/mbox.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/b4/mbox.py b/b4/mbox.py index 9b94af8..337875b 100644 --- a/b4/mbox.py +++ b/b4/mbox.py @@ -147,6 +147,23 @@ def make_am(msgs, cmdargs, msgid): logger.critical('Total patches: %s', len(am_msgs)) else: logger.info('Total patches: %s (cherrypicked: %s)', len(am_msgs), cmdargs.cherrypick) + # Check if any of the followup-trailers is an Obsoleted-by + if not cmdargs.checknewer: + warned = False + for lmsg in lser.patches: + # Only check cover letter or first patch + if lmsg.counter > 1: + continue + for trailer in list(lmsg.followup_trailers): + if trailer[0].lower() == 'obsoleted-by': + lmsg.followup_trailers.remove(trailer) + if warned: + continue + logger.critical('---') + logger.critical('WARNING: Found an Obsoleted-by follow-up trailer!') + logger.critical(' Rerun with -c to automatically retrieve the new series.') + warned = True + if lser.has_cover and lser.patches[0].followup_trailers and not covertrailers: # Warn that some trailers were sent to the cover letter logger.critical('---') -- cgit v1.2.3