# HG changeset patch # User Jun Wu # Date 1504756493 25200 # Node ID 50df6cf227176235e5268496eac4aaf098f890f5 # Parent 4f60720cf0df68dc455cba1a11c8fc9711222811 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 diff -r 4f60720cf0df -r 50df6cf22717 hgext/blackbox.py --- 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)