aboutsummaryrefslogtreecommitdiff
path: root/b4/mbox.py
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2022-06-16 11:31:35 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2022-06-16 11:31:35 -0400
commit0bff0fb4375a40755ec0ffcc3eb6c67e195baefc (patch)
treef05a6c8308122fc3304e0eb0167a12adf0b04ac6 /b4/mbox.py
parent6e1452d7e5008a1712aac0fb95bc4e377f95821b (diff)
downloadb4-0bff0fb4375a40755ec0ffcc3eb6c67e195baefc.tar.gz
Allow breaking threads using --no-parent
It is a common request to be able to get a partial thread in case someone submitted an auxiliary standalone patch in the middle of a larger patch series. Passing the msgid of the start of the thread along with --no-parent should tell b4 to break the thread at the start of the message-id specified and only consider that message and its children. Suggested-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/tools/YpTI9lhCfA7shi6j@sirena.org.uk/ Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Diffstat (limited to 'b4/mbox.py')
-rw-r--r--b4/mbox.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/b4/mbox.py b/b4/mbox.py
index c2e6319..4ac2c29 100644
--- a/b4/mbox.py
+++ b/b4/mbox.py
@@ -656,12 +656,9 @@ def get_msgs(cmdargs) -> Tuple[Optional[str], Optional[list]]:
sys.exit(1)
pickings = set()
- try:
- if cmdargs.cherrypick == '_':
- # Just that msgid, please
- pickings = {msgid}
- except AttributeError:
- pass
+ if 'cherrypick' in cmdargs and cmdargs.cherrypick == '_':
+ # Just that msgid, please
+ pickings = {msgid}
msgs = b4.get_pi_thread_by_msgid(msgid, useproject=cmdargs.useproject, nocache=cmdargs.nocache,
onlymsgids=pickings)
if not msgs:
@@ -693,6 +690,9 @@ def get_msgs(cmdargs) -> Tuple[Optional[str], Optional[list]]:
logger.critical('Mailbox %s does not exist', cmdargs.localmbox)
sys.exit(1)
+ if msgid and 'noparent' in cmdargs and cmdargs.noparent:
+ msgs = b4.get_strict_thread(msgs, msgid, noparent=True)
+
if not msgid and msgs:
for msg in msgs:
msgid = msg.get('Message-ID', None)