httppeer: declare 'dbg' at the function level stable
authorBoris Feld <boris.feld@octobus.net>
Mon, 21 May 2018 15:14:46 +0200
branchstable
changeset 38033 13b2812cff2b
parent 38032 f9dc1d5b676b
child 38037 d46a38c07b1a
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.
mercurial/httppeer.py
--- a/mercurial/httppeer.py	Fri May 04 19:06:46 2018 +0200
+++ b/mercurial/httppeer.py	Mon May 21 15:14:46 2018 +0200
@@ -277,9 +277,9 @@
 
     Returns the response object.
     """
+    dbg = ui.debug
     if (ui.debugflag
         and ui.configbool('devel', 'debug.peer-request')):
-        dbg = ui.debug
         line = 'devel-peer-request: %s\n'
         dbg(line % '%s %s' % (pycompat.bytesurl(req.get_method()),
                               pycompat.bytesurl(req.get_full_url())))