# HG changeset patch
# User Yuya Nishihara <y...@tcha.org>
# Date 1541922270 -32400
#      Sun Nov 11 16:44:30 2018 +0900
# Node ID 3fd774814e7e80fbaaac3f6a610d49393d0444b5
# Parent  ac34d1daab7fddeafc6a9f171965f82c24c40759
blackbox: inline temporary variables which are referenced only once

diff --git a/hgext/blackbox.py b/hgext/blackbox.py
--- a/hgext/blackbox.py
+++ b/hgext/blackbox.py
@@ -165,9 +165,6 @@ def wrapui(ui):
             else:
                 return
 
-            vfs = ui._bbvfs
-            repo = ui._bbrepo
-
             if getattr(ui, '_bbinlog', False):
                 # recursion and failure guard
                 return
@@ -180,7 +177,7 @@ def wrapui(ui):
             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 @@ def wrapui(ui):
             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' %
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to