Mercurial > public > mercurial-scm > hg
comparison mercurial/httppeer.py @ 39436:3fe028b657bf
httppeer: log commands for version 2 peer
This will aid testing and debugging.
Differential Revision: https://phab.mercurial-scm.org/D4437
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Fri, 31 Aug 2018 08:57:14 -0700 |
parents | e7aa113b14f7 |
children | 3c6f7eebc010 |
comparison
equal
deleted
inserted
replaced
39435:1467b6c27ff9 | 39436:3fe028b657bf |
---|---|
34 wireprotov2peer, | 34 wireprotov2peer, |
35 wireprotov2server, | 35 wireprotov2server, |
36 ) | 36 ) |
37 from .utils import ( | 37 from .utils import ( |
38 interfaceutil, | 38 interfaceutil, |
39 stringutil, | |
39 ) | 40 ) |
40 | 41 |
41 httplib = util.httplib | 42 httplib = util.httplib |
42 urlerr = util.urlerr | 43 urlerr = util.urlerr |
43 urlreq = util.urlreq | 44 urlreq = util.urlreq |
555 if len(requests) > 1: | 556 if len(requests) > 1: |
556 url += '/multirequest' | 557 url += '/multirequest' |
557 else: | 558 else: |
558 url += '/%s' % requests[0][0] | 559 url += '/%s' % requests[0][0] |
559 | 560 |
561 ui.debug('sending %d commands\n' % len(requests)) | |
560 for command, args, f in requests: | 562 for command, args, f in requests: |
563 ui.debug('sending command %s: %s\n' % ( | |
564 command, stringutil.pprint(args, indent=2))) | |
561 assert not list(handler.callcommand(command, args, f)) | 565 assert not list(handler.callcommand(command, args, f)) |
562 | 566 |
563 # TODO stream this. | 567 # TODO stream this. |
564 body = b''.join(map(bytes, handler.flushcommands())) | 568 body = b''.join(map(bytes, handler.flushcommands())) |
565 | 569 |