blackbox: inline _bbwrite
There is no need to make it a separate method. This makes the next change
easier to read.
Differential Revision: https://phab.mercurial-scm.org/D649
--- a/hgext/blackbox.py Wed Sep 06 19:27:30 2017 -0700
+++ b/hgext/blackbox.py Wed Sep 06 20:54:53 2017 -0700
@@ -135,10 +135,6 @@
newpath=maxfiles > 0 and path + '.1')
return self._bbvfs(name, 'a')
- def _bbwrite(self, fmt, *args):
- self._bbfp.write(fmt % args)
- self._bbfp.flush()
-
def log(self, event, *msg, **opts):
global lastui
super(blackboxui, self).log(event, *msg, **opts)
@@ -192,8 +188,11 @@
else:
src = ''
try:
- ui._bbwrite('%s %s @%s%s (%s)%s> %s',
- date, user, rev, changed, pid, src, formattedmsg)
+ fp = ui._bbfp
+ fmt = '%s %s @%s%s (%s)%s> %s'
+ args = (date, user, rev, changed, pid, src, formattedmsg)
+ fp.write(fmt % args)
+ fp.flush()
except IOError as err:
self.debug('warning: cannot write to blackbox.log: %s\n' %
err.strerror)