diff -r b77aa48ba690 -r 734515aca84d mercurial/debugcommands.py --- a/mercurial/debugcommands.py Tue Apr 10 18:13:28 2018 -0700 +++ b/mercurial/debugcommands.py Tue Apr 10 14:29:15 2018 -0700 @@ -33,6 +33,9 @@ nullrev, short, ) +from .thirdparty import ( + cbor, +) from . import ( bundle2, changegroup, @@ -3045,9 +3048,14 @@ req.get_method = lambda: method try: - opener.open(req).read() + res = opener.open(req) + body = res.read() except util.urlerr.urlerror as e: e.read() + continue + + if res.headers.get('Content-Type') == 'application/mercurial-cbor': + ui.write(_('cbor> %s\n') % stringutil.pprint(cbor.loads(body))) elif action == 'close': peer.close()