aboutsummaryrefslogtreecommitdiff
path: root/b4/mbox.py
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-05-20 18:02:29 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-05-20 18:02:29 -0400
commit3a07935e20c0ae3ff6cce31579b596abfcab21c8 (patch)
treeb85d9ae1aeb6d5069fbce306e3b7fa4d87fe2b11 /b4/mbox.py
parent25d22726f626a9957d0a420fe46c530cbcb0dd60 (diff)
downloadb4-3a07935e20c0ae3ff6cce31579b596abfcab21c8.tar.gz
Reimplement single-msgid cherrypicking
When processing -P_, filter by that msgid (and its follow-ups) early on, instead of parsing the entire thread and only then looking for matches. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Diffstat (limited to 'b4/mbox.py')
-rw-r--r--b4/mbox.py17
1 files changed, 6 insertions, 11 deletions
diff --git a/b4/mbox.py b/b4/mbox.py
index fab9569..9b94af8 100644
--- a/b4/mbox.py
+++ b/b4/mbox.py
@@ -47,16 +47,6 @@ def make_am(msgs, cmdargs, msgid):
reroll = True
if cmdargs.nopartialreroll:
reroll = False
- if cmdargs.cherrypick == '_' and not wantver and len(lmbx.series) > 1:
- # Make sure we pick the revision containing the msgid
- wantver = None
- for cnum, clser in lmbx.series.items():
- for lmsg in clser.patches:
- if lmsg and lmsg.msgid == msgid:
- wantver = cnum
- break
- if wantver:
- break
lser = lmbx.get_series(revision=wantver, sloppytrailers=cmdargs.sloppytrailers, reroll=reroll)
if lser is None and wantver is None:
@@ -540,7 +530,12 @@ def main(cmdargs):
logger.error('Error: pipe a message or pass msgid as parameter')
sys.exit(1)
- msgs = b4.get_pi_thread_by_msgid(msgid, useproject=cmdargs.useproject, nocache=cmdargs.nocache)
+ pickings = set()
+ if 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:
return
else: