hgext/blackbox.py
changeset 40630 5bd3d6b264c1
parent 40439 25f1c7bd649d
child 40631 345cdb93851b
--- a/hgext/blackbox.py	Wed Nov 14 10:15:28 2018 -0500
+++ b/hgext/blackbox.py	Sun Nov 11 16:34:49 2018 +0900
@@ -169,9 +169,9 @@
             if not vfs:
                 return
 
-            repo = getattr(ui, '_bbrepo', None)
-            if not lastui or repo:
-                lastui = ui
+            repo = ui._bbrepo
+            lastui = ui
+
             if getattr(ui, '_bbinlog', False):
                 # recursion and failure guard
                 return
@@ -184,13 +184,12 @@
             formattedmsg = msg[0] % msg[1:]
             rev = '(unknown)'
             changed = ''
-            if repo:
-                ctx = repo[None]
-                parents = ctx.parents()
-                rev = ('+'.join([hex(p.node()) for p in parents]))
-                if (ui.configbool('blackbox', 'dirty') and
-                    ctx.dirty(missing=True, merge=False, branch=False)):
-                    changed = '+'
+            ctx = repo[None]
+            parents = ctx.parents()
+            rev = ('+'.join([hex(p.node()) for p in parents]))
+            if (ui.configbool('blackbox', 'dirty') and
+                ctx.dirty(missing=True, merge=False, branch=False)):
+                changed = '+'
             if ui.configbool('blackbox', 'logsource'):
                 src = ' [%s]' % event
             else: