mercurial/wireproto.py
changeset 36258 af0a19d8812b
parent 36223 2e07dc514073
child 36314 be9c497e0bfd
equal deleted inserted replaced
36257:46c97973ee46 36258:af0a19d8812b
   877         prefercompressed = info.get('prefercompressed', True)
   877         prefercompressed = info.get('prefercompressed', True)
   878     except error.Abort as exc:
   878     except error.Abort as exc:
   879         # cleanly forward Abort error to the client
   879         # cleanly forward Abort error to the client
   880         if not exchange.bundle2requested(opts.get('bundlecaps')):
   880         if not exchange.bundle2requested(opts.get('bundlecaps')):
   881             if proto.name == 'http-v1':
   881             if proto.name == 'http-v1':
   882                 return ooberror(str(exc) + '\n')
   882                 return ooberror(pycompat.bytestr(exc) + '\n')
   883             raise # cannot do better for bundle1 + ssh
   883             raise # cannot do better for bundle1 + ssh
   884         # bundle2 request expect a bundle2 reply
   884         # bundle2 request expect a bundle2 reply
   885         bundler = bundle2.bundle20(repo.ui)
   885         bundler = bundle2.bundle20(repo.ui)
   886         manargs = [('message', str(exc))]
   886         manargs = [('message', pycompat.bytestr(exc))]
   887         advargs = []
   887         advargs = []
   888         if exc.hint is not None:
   888         if exc.hint is not None:
   889             advargs.append(('hint', exc.hint))
   889             advargs.append(('hint', exc.hint))
   890         bundler.addpart(bundle2.bundlepart('error:abort',
   890         bundler.addpart(bundle2.bundlepart('error:abort',
   891                                            manargs, advargs))
   891                                            manargs, advargs))