summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-05-21 10:05:43 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-05-21 10:05:43 -0400
commit7a20dcf82257604586b29642d078194447d492b7 (patch)
tree3705ec9020674c3004c32f95bcc1467eef78ff80
parent3a07935e20c0ae3ff6cce31579b596abfcab21c8 (diff)
downloadb4-7a20dcf82257604586b29642d078194447d492b7.tar.gz
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 <konstantin@linuxfoundation.org>
-rw-r--r--b4/mbox.py17
1 files changed, 17 insertions, 0 deletions
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('---')