Patchwork D649: blackbox: inline _bbwrite

login
register
mail settings
Submitter phabricator
Date Sept. 12, 2017, 2:13 p.m.
Message ID <7c3ca0f6864c2cec1e077c12d22ef3b6@localhost.localdomain>
Download mbox | patch
Permalink /patch/23810/
State Not Applicable
Headers show

Comments

phabricator - Sept. 12, 2017, 2:13 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG50df6cf22717: blackbox: inline _bbwrite (authored by quark).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D649?vs=1652&id=1751

REVISION DETAIL
  https://phab.mercurial-scm.org/D649

AFFECTED FILES
  hgext/blackbox.py

CHANGE DETAILS




To: quark, #hg-reviewers, durham
Cc: mercurial-devel

Patch

diff --git a/hgext/blackbox.py b/hgext/blackbox.py
--- a/hgext/blackbox.py
+++ b/hgext/blackbox.py
@@ -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)