# HG changeset patch # User Yuya Nishihara # Date 1541922270 -32400 # Node ID 4a38a67d0e96880219597b5ee9ce2e59b42e6398 # Parent da3bc2f54b0238c58a3bf64b409892725d2f252f blackbox: inline temporary variables which are referenced only once diff -r da3bc2f54b02 -r 4a38a67d0e96 hgext/blackbox.py --- a/hgext/blackbox.py Sun Nov 11 16:43:29 2018 +0900 +++ b/hgext/blackbox.py Sun Nov 11 16:44:30 2018 +0900 @@ -165,9 +165,6 @@ else: return - vfs = ui._bbvfs - repo = ui._bbrepo - if getattr(ui, '_bbinlog', False): # recursion and failure guard return @@ -180,7 +177,7 @@ formattedmsg = msg[0] % msg[1:] rev = '(unknown)' changed = '' - ctx = repo[None] + ctx = ui._bbrepo[None] parents = ctx.parents() rev = ('+'.join([hex(p.node()) for p in parents])) if (ui.configbool('blackbox', 'dirty') and @@ -193,7 +190,7 @@ try: fmt = '%s %s @%s%s (%s)%s> %s' args = (date, user, rev, changed, pid, src, formattedmsg) - with _openlogfile(ui, vfs) as fp: + with _openlogfile(ui, ui._bbvfs) as fp: fp.write(fmt % args) except (IOError, OSError) as err: self.debug('warning: cannot write to blackbox.log: %s\n' %