# HG changeset patch # User Yuya Nishihara <y...@tcha.org> # Date 1541921689 -32400 # Sun Nov 11 16:34:49 2018 +0900 # Node ID cac5ea779ab85b840da04b2947d11b7ec2de9f61 # Parent 29e4a77b5305df7b14d04b99cba03f1a079dd1fc 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. diff --git a/hgext/blackbox.py b/hgext/blackbox.py --- a/hgext/blackbox.py +++ b/hgext/blackbox.py @@ -169,9 +169,9 @@ def wrapui(ui): 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 @@ def wrapui(ui): 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: _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel