aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-06-22 10:41:38 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-06-22 10:41:38 -0400
commita5a225c4471aa94dabbf93d9c3172fb8aa58a8f0 (patch)
treead3f6fc508063aa442158b39159cba01bc52db6f
parent48bdd2a2de11bfac3ac25fcb9930dbbf44fcddef (diff)
downloadb4-a5a225c4471aa94dabbf93d9c3172fb8aa58a8f0.tar.gz
Tweak --guess-base output
Run the check against current tree even if no --guess-base is specified (it's cheap). Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/mbox.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/b4/mbox.py b/b4/mbox.py
index 7adfecd..7e01e44 100644
--- a/b4/mbox.py
+++ b/b4/mbox.py
@@ -230,12 +230,7 @@ def make_am(msgs, cmdargs, msgid):
logger.critical(' Base: %s', base_commit)
else:
if topdir is not None:
- guessed = False
- checked, mismatches = lser.check_applies_clean(topdir, at=cmdargs.guessbranch)
- if len(mismatches) == 0 and checked != mismatches:
- guessed = True
- logger.critical(' Base: current tree')
- if not guessed and cmdargs.guessbase:
+ if cmdargs.guessbase:
logger.critical(' attempting to guess base-commit...')
try:
base_commit, nblobs, mismatches = lser.find_base(topdir, branches=cmdargs.guessbranch,
@@ -246,11 +241,15 @@ def make_am(msgs, cmdargs, msgid):
logger.critical(' Base: failed to guess base')
else:
logger.critical(' Base: %s (best guess, %s/%s blobs matched)', base_commit,
- nblobs-mismatches, nblobs)
+ nblobs - mismatches, nblobs)
except IndexError:
logger.critical(' Base: failed to guess base')
- elif not cmdargs.guessbase:
- logger.critical(' Base: not specified')
+ else:
+ checked, mismatches = lser.check_applies_clean(topdir, at=cmdargs.guessbranch)
+ if len(mismatches) == 0 and checked != mismatches:
+ logger.critical(' Base: applies clean to current tree')
+ else:
+ logger.critical(' Base: not specified')
else:
logger.critical(' Base: not specified')