mercurial/bundle2.py
changeset 35117 589eed45a452
parent 35116 da91e7309daf
child 35118 1fb0846ad792
--- a/mercurial/bundle2.py	Mon Nov 13 21:10:37 2017 -0800
+++ b/mercurial/bundle2.py	Mon Nov 13 22:05:54 2017 -0800
@@ -1193,6 +1193,9 @@
     Part payload data consists of framed chunks. This function takes
     a file handle and emits those chunks.
     """
+    dolog = ui.configbool('devel', 'bundle2.debug')
+    debug = ui.debug
+
     headersize = struct.calcsize(_fpayloadsize)
     readexactly = changegroup.readexactly
 
@@ -1211,7 +1214,10 @@
                 'negative payload chunk size: %s' % chunksize)
 
         chunksize = _unpack(_fpayloadsize, readexactly(fh, headersize))[0]
-        indebug(ui, 'payload chunk size: %i' % chunksize)
+
+        # indebug() inlined for performance.
+        if dolog:
+            debug('bundle2-input: payload chunk size: %i\n' % chunksize)
 
 class unbundlepart(unpackermixin):
     """a bundle part read from a bundle"""