httppeer: properly gate debug usage behind debug flag check stable
authorBoris Feld <boris.feld@octobus.net>
Fri, 04 May 2018 19:06:46 +0200
branchstable
changeset 37842 f9dc1d5b676b
parent 37841 7c05198cd1ca
child 37843 13b2812cff2b
httppeer: properly gate debug usage behind debug flag check The "dbg" local variable is only defined if the 'debugflag' is set to True. However, it was used indiscriminately later in the function. We hide its usage behind the 'debugflag' value to avoid raising a NameError.
mercurial/httppeer.py
--- a/mercurial/httppeer.py	Tue May 15 22:12:55 2018 +0900
+++ b/mercurial/httppeer.py	Fri May 04 19:06:46 2018 +0200
@@ -319,7 +319,7 @@
         ui.traceback()
         raise IOError(None, inst)
     finally:
-        if ui.configbool('devel', 'debug.peer-request'):
+        if ui.debugflag and ui.configbool('devel', 'debug.peer-request'):
             dbg(line % '  finished in %.4f seconds (%d)'
                 % (util.timer() - start, res.code))