# HG changeset patch # User Boris Feld # Date 1520268508 18000 # Node ID 4901d1e22b270021b3547e8e3ccdf78fe69de880 # Parent 65615c29e74f632c6597d7fb5cc74724d7963ec1 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. diff -r 65615c29e74f -r 4901d1e22b27 mercurial/wireproto.py --- 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] diff -r 65615c29e74f -r 4901d1e22b27 tests/test-http.t --- 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 diff -r 65615c29e74f -r 4901d1e22b27 tests/test-ssh.t --- 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