aboutsummaryrefslogtreecommitdiff
path: root/b4/__init__.py
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-10-02 08:56:39 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-10-02 08:56:39 -0400
commitca6d35e7728c17b505e6be62ec3b6687aa5bf26b (patch)
tree28ca6c911735d941184c8932f9e2cb2f37c0e035 /b4/__init__.py
parentb34efebe5026567efad9cd71f308000504dd8e31 (diff)
downloadb4-ca6d35e7728c17b505e6be62ec3b6687aa5bf26b.tar.gz
Fix some cherry-picking corner cases
Handle several corner cases when trying to cherrypick from incomplete series. Reported-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Diffstat (limited to 'b4/__init__.py')
-rw-r--r--b4/__init__.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/b4/__init__.py b/b4/__init__.py
index f0d5d24..dc393a9 100644
--- a/b4/__init__.py
+++ b/b4/__init__.py
@@ -504,10 +504,14 @@ class LoreSeries:
at = 1
atterrors = list()
for lmsg in self.patches[1:]:
- if cherrypick is not None and at not in cherrypick:
- at += 1
- logger.debug(' skipped: [%s/%s] (not in cherrypick)', at, self.expected)
- continue
+ if cherrypick is not None:
+ if at not in cherrypick:
+ at += 1
+ logger.debug(' skipped: [%s/%s] (not in cherrypick)', at, self.expected)
+ continue
+ if lmsg is None:
+ logger.critical('CRITICAL: [%s/%s] is missing, cannot cherrypick', at, self.expected)
+ raise KeyError('Cherrypick not in series')
if lmsg is not None:
if self.has_cover and covertrailers and self.patches[0].followup_trailers:
lmsg.followup_trailers += self.patches[0].followup_trailers