summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-05-07 11:23:37 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-05-07 11:23:37 -0400
commitafd622604f9ec4360d50b6e32b11fc66e44d62a1 (patch)
tree616a532d104186b8f444a67e7ec806880003afbd
parent82c37bbbebae6678b68580ae11a161223a8ed7b4 (diff)
downloadb4-afd622604f9ec4360d50b6e32b11fc66e44d62a1.tar.gz
Do not crash when thread is incomplete
Do not try to calculate indexes on a missing patch in an incomplete thread. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/__init__.py2
-rw-r--r--b4/command.py2
-rw-r--r--b4/mbox.py4
3 files changed, 5 insertions, 3 deletions
diff --git a/b4/__init__.py b/b4/__init__.py
index cc93adc..a6b683e 100644
--- a/b4/__init__.py
+++ b/b4/__init__.py
@@ -585,7 +585,7 @@ class LoreSeries:
mismatches = 0
seenfiles = set()
for lmsg in self.patches[1:]:
- if lmsg.blob_indexes is None:
+ if lmsg is None or lmsg.blob_indexes is None:
continue
for fn, bh in lmsg.blob_indexes:
if fn in seenfiles:
diff --git a/b4/command.py b/b4/command.py
index 39ad3e5..54b79f5 100644
--- a/b4/command.py
+++ b/b4/command.py
@@ -61,7 +61,9 @@ def cmd_ty(cmdargs):
def cmd():
+ # noinspection PyTypeChecker
parser = argparse.ArgumentParser(
+ prog='b4',
description='A tool to work with public-inbox patches',
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
diff --git a/b4/mbox.py b/b4/mbox.py
index 5494cab..a859c21 100644
--- a/b4/mbox.py
+++ b/b4/mbox.py
@@ -151,7 +151,7 @@ def mbox_to_am(mboxfile, cmdargs):
else:
best_matches = None
# sort the tags by authordate
- gitargs = ['tag', '-l', '--sort=-creatordate']
+ gitargs = ['tag', '-l', '--sort=-taggerdate']
lines = b4.git_get_command_lines(None, gitargs)
if lines:
# Check last 10 tags
@@ -159,7 +159,7 @@ def mbox_to_am(mboxfile, cmdargs):
logger.debug('Checking base-commit possibility for %s', tag)
checked, mismatches = lser.check_applies_clean(topdir, tag)
if mismatches == 0 and checked != mismatches:
- base_commit = tag
+ cleanmsg = ' (applies clean to: %s)' % tag
break
# did they all mismatch?
if checked == mismatches: