stream_in: avoid debug calls when debug is disabled
authorMatt Mackall <mpm@selenic.com>
Thu, 12 Apr 2012 20:22:18 -0500
changeset 16398 def789752b60
parent 16397 f0f7f3fab315
child 16399 7416ce2c7887
stream_in: avoid debug calls when debug is disabled
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Thu Apr 12 20:22:18 2012 -0500
+++ b/mercurial/localrepo.py	Thu Apr 12 20:22:18 2012 -0500
@@ -2224,7 +2224,9 @@
                 except (ValueError, TypeError):
                     raise error.ResponseError(
                         _('Unexpected response from remote server:'), l)
-                self.ui.debug('adding %s (%s)\n' % (name, util.bytecount(size)))
+                if self.ui.debugflag:
+                    self.ui.debug('adding %s (%s)\n' %
+                                  (name, util.bytecount(size)))
                 # for backwards compat, name was partially encoded
                 ofp = self.sopener(store.decodedir(name), 'w')
                 for chunk in util.filechunkiter(fp, limit=size):