Mercurial > public > mercurial-scm > hg
comparison mercurial/httppeer.py @ 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 | 6169d95dce3b |
children | 13b2812cff2b |
comparison
equal
deleted
inserted
replaced
38000:7c05198cd1ca | 38032:f9dc1d5b676b |
---|---|
317 ui.debug('http error requesting %s\n' % | 317 ui.debug('http error requesting %s\n' % |
318 util.hidepassword(req.get_full_url())) | 318 util.hidepassword(req.get_full_url())) |
319 ui.traceback() | 319 ui.traceback() |
320 raise IOError(None, inst) | 320 raise IOError(None, inst) |
321 finally: | 321 finally: |
322 if ui.configbool('devel', 'debug.peer-request'): | 322 if ui.debugflag and ui.configbool('devel', 'debug.peer-request'): |
323 dbg(line % ' finished in %.4f seconds (%d)' | 323 dbg(line % ' finished in %.4f seconds (%d)' |
324 % (util.timer() - start, res.code)) | 324 % (util.timer() - start, res.code)) |
325 | 325 |
326 # Insert error handlers for common I/O failures. | 326 # Insert error handlers for common I/O failures. |
327 _wraphttpresponse(res) | 327 _wraphttpresponse(res) |