peer-request: include more details about batch commands
A batch commands encapsulate multiple other commands. We display a bit more
details about what is actually batched if peer request tracking is set.
--- a/mercurial/wireproto.py Wed Mar 14 15:56:34 2018 -0400
+++ b/mercurial/wireproto.py Mon Mar 05 11:48:28 2018 -0500
@@ -400,6 +400,13 @@
Returns an iterator of the raw responses from the server.
"""
+ ui = self.ui
+ if ui.debugflag and ui.configbool('devel', 'debug.peer-request'):
+ ui.debug('devel-peer-request: batched-content\n')
+ for op, args in req:
+ msg = 'devel-peer-request: - %s (%d arguments)\n'
+ ui.debug(msg % (op, len(args)))
+
rsp = self._callstream("batch", cmds=encodebatchcmds(req))
chunk = rsp.read(1024)
work = [chunk]
--- a/tests/test-http.t Wed Mar 14 15:56:34 2018 -0400
+++ b/tests/test-http.t Mon Mar 05 11:48:28 2018 -0500
@@ -257,6 +257,9 @@
http auth: user user, password ****
devel-peer-request: finished in *.???? seconds (200) (glob)
query 1; heads
+ devel-peer-request: batched-content
+ devel-peer-request: - heads (0 arguments)
+ devel-peer-request: - known (1 arguments)
sending batch command
devel-peer-request: GET http://localhost:$HGPORT2/?cmd=batch
devel-peer-request: Vary X-HgArg-1,X-HgProto-1
--- a/tests/test-ssh.t Wed Mar 14 15:56:34 2018 -0400
+++ b/tests/test-ssh.t Mon Mar 05 11:48:28 2018 -0500
@@ -501,6 +501,9 @@
remote: capabilities: lookup branchmap pushkey known getbundle unbundlehash batch changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
remote: 1 (sshv1 !)
query 1; heads
+ devel-peer-request: batched-content
+ devel-peer-request: - heads (0 arguments)
+ devel-peer-request: - known (1 arguments)
devel-peer-request: batch
devel-peer-request: cmds: 141 bytes
sending batch command