changeset 40633:4a38a67d0e96

blackbox: inline temporary variables which are referenced only once
author Yuya Nishihara <yuya@tcha.org>
date Sun, 11 Nov 2018 16:44:30 +0900
parents da3bc2f54b02
children c9876c00d292
files hgext/blackbox.py
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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' %