mercurial/wireproto.py
changeset 36314 be9c497e0bfd
parent 36258 af0a19d8812b
child 36431 ec43960b03e8
equal deleted inserted replaced
36313:3f98634b6572 36314:be9c497e0bfd
   925         k = encoding.tolocal(key)
   925         k = encoding.tolocal(key)
   926         c = repo[k]
   926         c = repo[k]
   927         r = c.hex()
   927         r = c.hex()
   928         success = 1
   928         success = 1
   929     except Exception as inst:
   929     except Exception as inst:
   930         r = str(inst)
   930         r = util.forcebytestr(inst)
   931         success = 0
   931         success = 0
   932     return bytesresponse('%d %s\n' % (success, r))
   932     return bytesresponse('%d %s\n' % (success, r))
   933 
   933 
   934 @wireprotocommand('known', 'nodes *')
   934 @wireprotocommand('known', 'nodes *')
   935 def known(repo, proto, nodes, others):
   935 def known(repo, proto, nodes, others):
  1053                 if exc.parttype is not None:
  1053                 if exc.parttype is not None:
  1054                     errpart.addparam('parttype', exc.parttype)
  1054                     errpart.addparam('parttype', exc.parttype)
  1055                 if exc.params:
  1055                 if exc.params:
  1056                     errpart.addparam('params', '\0'.join(exc.params))
  1056                     errpart.addparam('params', '\0'.join(exc.params))
  1057             except error.Abort as exc:
  1057             except error.Abort as exc:
  1058                 manargs = [('message', str(exc))]
  1058                 manargs = [('message', util.forcebytestr(exc))]
  1059                 advargs = []
  1059                 advargs = []
  1060                 if exc.hint is not None:
  1060                 if exc.hint is not None:
  1061                     advargs.append(('hint', exc.hint))
  1061                     advargs.append(('hint', exc.hint))
  1062                 bundler.addpart(bundle2.bundlepart('error:abort',
  1062                 bundler.addpart(bundle2.bundlepart('error:abort',
  1063                                                    manargs, advargs))
  1063                                                    manargs, advargs))
  1064             except error.PushRaced as exc:
  1064             except error.PushRaced as exc:
  1065                 bundler.newpart('error:pushraced', [('message', str(exc))])
  1065                 bundler.newpart('error:pushraced',
       
  1066                                 [('message', util.forcebytestr(exc))])
  1066             return streamres_legacy(gen=bundler.getchunks())
  1067             return streamres_legacy(gen=bundler.getchunks())