# HG changeset patch # User Boris Feld # Date 2018-03-05 16:48:28 # 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 --git a/mercurial/wireproto.py b/mercurial/wireproto.py --- a/mercurial/wireproto.py +++ b/mercurial/wireproto.py @@ -400,6 +400,13 @@ class wirepeer(repository.legacypeer): 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 --git a/tests/test-http.t b/tests/test-http.t --- a/tests/test-http.t +++ b/tests/test-http.t @@ -257,6 +257,9 @@ test http authentication 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 --git a/tests/test-ssh.t b/tests/test-ssh.t --- a/tests/test-ssh.t +++ b/tests/test-ssh.t @@ -501,6 +501,9 @@ debug output 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