aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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')