# HG changeset patch # User Matt Mackall # Date 2012-04-13 01:22:18 # Node ID def789752b605ecc645b2a43f43c1b1ac5c983e5 # Parent f0f7f3fab31528e75dc3bbd852fd3c23ec3316af stream_in: avoid debug calls when debug is disabled diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -2224,7 +2224,9 @@ class localrepository(repo.repository): 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):