blackbox: remove redundant check for unassigned repo
Since ui._bbvfs is looked through ui._bbrepo, the repo instance should
exist if ui._bbvfs isn't None.
--- 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: