Mercurial > hg
diff mercurial/debugcommands.py @ 37722:89a16704114c
wireprotov2: define response data as CBOR
Previously, response data was defined as a stream of bytes. We had
the option to declare it as CBOR using a frame flag.
We've converged all wire protocol commands exposed on version 2 to
CBOR. I think consistency is important. The overhead to encoding
things with CBOR is minimal. Even a very large bytestring can be
efficiently encoded using an indefinite length bytestring. Now,
there are limitations with consumers not being able to efficiently
stream large CBOR values. But these feel like solvable problems.
This commit removes the "is CBOR" frame flag from command response
frames and defines the frame as always consisting of a stream of
CBOR values.
The framing protocol media type has been bumped to reflect this
BC change.
Differential Revision: https://phab.mercurial-scm.org/D3382
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 14 Apr 2018 12:07:31 -0700 |
parents | d715a85003c8 |
children | 0e9ddab2bac2 |
line wrap: on
line diff
--- a/mercurial/debugcommands.py Sat Apr 14 11:49:06 2018 -0700 +++ b/mercurial/debugcommands.py Sat Apr 14 12:07:31 2018 -0700 @@ -3014,11 +3014,7 @@ res = e.callcommand(command, args).result() if isinstance(res, wireprotov2peer.commandresponse): - if res.cbor: - val = list(res.cborobjects()) - else: - val = [res.b.getvalue()] - + val = list(res.cborobjects()) ui.status(_('response: %s\n') % stringutil.pprint(val)) else: