mercurial/debugcommands.py
changeset 37557 734515aca84d
parent 37553 6b08cf6b900f
child 37558 8a73132214a3
equal deleted inserted replaced
37556:b77aa48ba690 37557:734515aca84d
    30     hex,
    30     hex,
    31     nullhex,
    31     nullhex,
    32     nullid,
    32     nullid,
    33     nullrev,
    33     nullrev,
    34     short,
    34     short,
       
    35 )
       
    36 from .thirdparty import (
       
    37     cbor,
    35 )
    38 )
    36 from . import (
    39 from . import (
    37     bundle2,
    40     bundle2,
    38     changegroup,
    41     changegroup,
    39     cmdutil,
    42     cmdutil,
  3043             # determining the request method. Override that to use our
  3046             # determining the request method. Override that to use our
  3044             # explicitly requested method.
  3047             # explicitly requested method.
  3045             req.get_method = lambda: method
  3048             req.get_method = lambda: method
  3046 
  3049 
  3047             try:
  3050             try:
  3048                 opener.open(req).read()
  3051                 res = opener.open(req)
       
  3052                 body = res.read()
  3049             except util.urlerr.urlerror as e:
  3053             except util.urlerr.urlerror as e:
  3050                 e.read()
  3054                 e.read()
       
  3055                 continue
       
  3056 
       
  3057             if res.headers.get('Content-Type') == 'application/mercurial-cbor':
       
  3058                 ui.write(_('cbor> %s\n') % stringutil.pprint(cbor.loads(body)))
  3051 
  3059 
  3052         elif action == 'close':
  3060         elif action == 'close':
  3053             peer.close()
  3061             peer.close()
  3054         elif action == 'readavailable':
  3062         elif action == 'readavailable':
  3055             if not stdout or not stderr:
  3063             if not stdout or not stderr: