changeset 38032:f9dc1d5b676b stable

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.
author Boris Feld <boris.feld@octobus.net>
date Fri, 04 May 2018 19:06:46 +0200
parents 7c05198cd1ca
children 13b2812cff2b
files mercurial/httppeer.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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))