mercurial/scmutil.py
changeset 45921 95c4cca641f6
parent 45910 fc4fb2f17dd4
child 45930 8f50dc096cf4
equal deleted inserted replaced
45920:e131dbf6ee15 45921:95c4cca641f6
   191         if inst.args:
   191         if inst.args:
   192             ui.error(b''.join(inst.args))
   192             ui.error(b''.join(inst.args))
   193         if inst.hint:
   193         if inst.hint:
   194             ui.error(b'(%s)\n' % inst.hint)
   194             ui.error(b'(%s)\n' % inst.hint)
   195     except error.RepoError as inst:
   195     except error.RepoError as inst:
   196         ui.error(_(b"abort: %s!\n") % inst)
   196         ui.error(_(b"abort: %s\n") % inst)
   197         if inst.hint:
   197         if inst.hint:
   198             ui.error(_(b"(%s)\n") % inst.hint)
   198             ui.error(_(b"(%s)\n") % inst.hint)
   199     except error.ResponseError as inst:
   199     except error.ResponseError as inst:
   200         ui.error(_(b"abort: %s") % inst.args[0])
   200         ui.error(_(b"abort: %s") % inst.args[0])
   201         msg = inst.args[1]
   201         msg = inst.args[1]
   206         elif not msg:
   206         elif not msg:
   207             ui.error(_(b" empty string\n"))
   207             ui.error(_(b" empty string\n"))
   208         else:
   208         else:
   209             ui.error(b"\n%r\n" % pycompat.bytestr(stringutil.ellipsis(msg)))
   209             ui.error(b"\n%r\n" % pycompat.bytestr(stringutil.ellipsis(msg)))
   210     except error.CensoredNodeError as inst:
   210     except error.CensoredNodeError as inst:
   211         ui.error(_(b"abort: file censored %s!\n") % inst)
   211         ui.error(_(b"abort: file censored %s\n") % inst)
   212     except error.StorageError as inst:
   212     except error.StorageError as inst:
   213         ui.error(_(b"abort: %s!\n") % inst)
   213         ui.error(_(b"abort: %s\n") % inst)
   214         if inst.hint:
   214         if inst.hint:
   215             ui.error(_(b"(%s)\n") % inst.hint)
   215             ui.error(_(b"(%s)\n") % inst.hint)
   216     except error.InterventionRequired as inst:
   216     except error.InterventionRequired as inst:
   217         ui.error(b"%s\n" % inst)
   217         ui.error(b"%s\n" % inst)
   218         if inst.hint:
   218         if inst.hint:
   233         ui.error(inst.format())
   233         ui.error(inst.format())
   234     except error.WorkerError as inst:
   234     except error.WorkerError as inst:
   235         # Don't print a message -- the worker already should have
   235         # Don't print a message -- the worker already should have
   236         return inst.status_code
   236         return inst.status_code
   237     except ImportError as inst:
   237     except ImportError as inst:
   238         ui.error(_(b"abort: %s!\n") % stringutil.forcebytestr(inst))
   238         ui.error(_(b"abort: %s\n") % stringutil.forcebytestr(inst))
   239         m = stringutil.forcebytestr(inst).split()[-1]
   239         m = stringutil.forcebytestr(inst).split()[-1]
   240         if m in b"mpatch bdiff".split():
   240         if m in b"mpatch bdiff".split():
   241             ui.error(_(b"(did you forget to compile extensions?)\n"))
   241             ui.error(_(b"(did you forget to compile extensions?)\n"))
   242         elif m in b"zlib".split():
   242         elif m in b"zlib".split():
   243             ui.error(_(b"(is your Python install correct?)\n"))
   243             ui.error(_(b"(is your Python install correct?)\n"))