changeset 40675:345cdb93851b

blackbox: consolidate conditions for early return Just pick the lastui only if it is usable.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 11 Nov 2018 16:38:43 +0900
parents 5bd3d6b264c1
children da3bc2f54b02
files hgext/blackbox.py
diffstat 1 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/blackbox.py	Sun Nov 11 16:34:49 2018 +0900
+++ b/hgext/blackbox.py	Sun Nov 11 16:38:43 2018 +0900
@@ -157,18 +157,15 @@
 
             if self._bbvfs:
                 ui = self
-            else:
+            elif lastui and lastui._bbvfs:
                 # certain ui instances exist outside the context of
                 # a repo, so just default to the last blackbox that
                 # was seen.
                 ui = lastui
-
-            if not ui:
-                return
-            vfs = ui._bbvfs
-            if not vfs:
+            else:
                 return
 
+            vfs = ui._bbvfs
             repo = ui._bbrepo
             lastui = ui