comparison mercurial/sshpeer.py @ 35699:f7ef49e44d7c

sshpeer: add support for request tracing The new 'devel.debug.peer-request' option now also display some information about request going through ssh peer.
author Boris Feld <boris.feld@octobus.net>
date Fri, 12 Jan 2018 11:52:57 +0000
parents b520c8f98e1e
children b0d2885c5945
comparison
equal deleted inserted replaced
35698:0c4b23ccf1a5 35699:f7ef49e44d7c
281 work += chunk 281 work += chunk
282 yield wireproto.unescapearg(work) 282 yield wireproto.unescapearg(work)
283 283
284 def _callstream(self, cmd, **args): 284 def _callstream(self, cmd, **args):
285 args = pycompat.byteskwargs(args) 285 args = pycompat.byteskwargs(args)
286 if (self.ui.debugflag
287 and self.ui.configbool('devel', 'debug.peer-request')):
288 dbg = self.ui.debug
289 line = 'devel-peer-request: %s\n'
290 dbg(line % cmd)
291 for key, value in sorted(args.items()):
292 if not isinstance(value, dict):
293 dbg(line % ' %s: %d bytes' % (key, len(value)))
294 else:
295 for dk, dv in sorted(value.items()):
296 dbg(line % ' %s-%s: %d' % (key, dk, len(dv)))
286 self.ui.debug("sending %s command\n" % cmd) 297 self.ui.debug("sending %s command\n" % cmd)
287 self._pipeo.write("%s\n" % cmd) 298 self._pipeo.write("%s\n" % cmd)
288 _func, names = wireproto.commands[cmd] 299 _func, names = wireproto.commands[cmd]
289 keys = names.split() 300 keys = names.split()
290 wireargs = {} 301 wireargs = {}