From f6f46cd221e35bf80d3b7c24ec4b4d799446399f Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Mon, 17 May 2021 12:04:09 -0400 Subject: Implement partial reroll It has been a common request to support partial series rerolls where someone sends an amended patch as a follow-up to a previous series, e.g.: [PATCH v3 1/3] Patch one [PATCH v3 2/3] Patch two \- Re: [PATCH v3 2/3] Patch two Looks good, but please fix this $small_thing \- [PATCH v4 2/3] Patch two [PATCH v3] Patch three Previously, b4 refused to consider v4 as a complete new series, but now it will properly perform a partial reroll, but only in the cases where such patches are sent as follow-ups to the exact same patch number in the previous series: [PATCH v3->v4 1/3] Patch one [PATCH v4 2/3] Patch two [PATCH v3->v4 3/3] Patch three Reported-by: Dan Williams Signed-off-by: Konstantin Ryabitsev Link: https://lore.kernel.org/r/CAPcyv4ggbuHbqKV33_TpE7pqxvRag34baJrX3yQe-jXOikoATQ@mail.gmail.com --- b4/mbox.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'b4/mbox.py') diff --git a/b4/mbox.py b/b4/mbox.py index 6d4c408..f0bae35 100644 --- a/b4/mbox.py +++ b/b4/mbox.py @@ -47,7 +47,10 @@ def mbox_to_am(mboxfile, cmdargs, msgid): for key, msg in mbx.items(): lmbx.add_message(msg) - lser = lmbx.get_series(revision=wantver, sloppytrailers=cmdargs.sloppytrailers) + reroll = True + if cmdargs.nopartialreroll: + reroll = False + lser = lmbx.get_series(revision=wantver, sloppytrailers=cmdargs.sloppytrailers, reroll=reroll) if lser is None and wantver is None: logger.critical('No patches found.') return @@ -156,6 +159,11 @@ def mbox_to_am(mboxfile, cmdargs, msgid): logger.info('Prepared a fake commit range for 3-way merge (%.12s..%.12s)', rstart, rend) logger.critical('---') + if lser.partial_reroll: + logger.critical('WARNING: v%s is a partial reroll from previous revisions', lser.revision) + logger.critical(' Please carefully review the resulting series to ensure correctness') + logger.critical(' Pass --no-partial-reroll to disable') + logger.critical('---') if not lser.complete and not cmdargs.cherrypick: logger.critical('WARNING: Thread incomplete!') -- cgit v1.2.3