[PATCH 4 of 4] sshpeer: add support for request tracing
Yuya Nishihara
yuya at tcha.org
Wed Jan 17 13:32:38 UTC 2018
On Tue, 16 Jan 2018 19:16:31 +0100, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld at octobus.net>
> # Date 1515757977 0
> # Fri Jan 12 11:52:57 2018 +0000
> # Node ID 6c6a7d225fef954f6e33eb734cd3a9ce72b0f85b
> # Parent 2d1a4bbddd7e4075b0e082cabf84d901f5b92b5b
> # EXP-Topic exchangedebug
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 6c6a7d225fef
> sshpeer: add support for request tracing
Seems fine.
A few nits. Can you send V2?
> diff --git a/mercurial/sshpeer.py b/mercurial/sshpeer.py
> --- a/mercurial/sshpeer.py
> +++ b/mercurial/sshpeer.py
> @@ -282,6 +282,16 @@ class sshpeer(wireproto.wirepeer):
> yield wireproto.unescapearg(work)
>
> def _callstream(self, cmd, **args):
Needs pycompat.byteskwargs(args) here.
> + if self.ui.configbool('devel', 'debug.peer-request'):
Perhaps it's better to test ui.debugflag, too. 'devel.*' flag might be
enabled by config file, but this is needed only when --debug is given by
command line.
> + dbg = self.ui.debug
> + line = 'devel-peer-request: %s\n'
> + dbg(line % cmd)
> + for key, value in sorted(args.items()):
> + if not isinstance(value, dict):
> + dbg(line % ' %s: %d bytes' % (key, len(value)))
> + else:
> + for dk, dv in sorted(value.items()):
> + dbg(line % ' %s-%s: %d' % (key, dk, len(value)))
^^^^^
dv?
> args = pycompat.byteskwargs(args)
> self.ui.debug("sending %s command\n" % cmd)
> self._pipeo.write("%s\n" % cmd)
More information about the Mercurial-devel
mailing list