comparison mercurial/httppeer.py @ 38033:13b2812cff2b stable

httppeer: declare 'dbg' at the function level As we just saw in the previous changeset, having the variable defined into a branch creates bug. This is a cheap to move it at the function level.
author Boris Feld <boris.feld@octobus.net>
date Mon, 21 May 2018 15:14:46 +0200
parents f9dc1d5b676b
children ead71b15efd5
comparison
equal deleted inserted replaced
38032:f9dc1d5b676b 38033:13b2812cff2b
275 def sendrequest(ui, opener, req): 275 def sendrequest(ui, opener, req):
276 """Send a prepared HTTP request. 276 """Send a prepared HTTP request.
277 277
278 Returns the response object. 278 Returns the response object.
279 """ 279 """
280 dbg = ui.debug
280 if (ui.debugflag 281 if (ui.debugflag
281 and ui.configbool('devel', 'debug.peer-request')): 282 and ui.configbool('devel', 'debug.peer-request')):
282 dbg = ui.debug
283 line = 'devel-peer-request: %s\n' 283 line = 'devel-peer-request: %s\n'
284 dbg(line % '%s %s' % (pycompat.bytesurl(req.get_method()), 284 dbg(line % '%s %s' % (pycompat.bytesurl(req.get_method()),
285 pycompat.bytesurl(req.get_full_url()))) 285 pycompat.bytesurl(req.get_full_url())))
286 hgargssize = None 286 hgargssize = None
287 287