From a5a225c4471aa94dabbf93d9c3172fb8aa58a8f0 Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Tue, 22 Jun 2021 10:41:38 -0400 Subject: 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 --- b4/mbox.py | 17 ++++++++--------- 1 file 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') -- cgit v1.2.3