comparison mercurial/chgserver.py @ 45884:98399dd1b96c

errors: make formatparse() an instance method on ParseError It's just a little simpler this way. Don't ask me what the "hg: " prefix signifies to the user, I just left it as it was. I think we should consider changing the prefixes later (maybe always use "abort: ", or maybe use more specific prefixes in general). Differential Revision: https://phab.mercurial-scm.org/D9347
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 20 Nov 2020 08:51:45 -0800
parents 4b4160a83303
children 600aec73f309
comparison
equal deleted inserted replaced
45883:1817b66897ad 45884:98399dd1b96c
60 encoding, 60 encoding,
61 error, 61 error,
62 extensions, 62 extensions,
63 node, 63 node,
64 pycompat, 64 pycompat,
65 scmutil,
66 util, 65 util,
67 ) 66 )
68 67
69 from .utils import ( 68 from .utils import (
70 hashutil, 69 hashutil,
506 """ 505 """
507 args = self._readlist() 506 args = self._readlist()
508 try: 507 try:
509 self.ui, lui = _loadnewui(self.ui, args, self.cdebug) 508 self.ui, lui = _loadnewui(self.ui, args, self.cdebug)
510 except error.ParseError as inst: 509 except error.ParseError as inst:
511 scmutil.formatparse(self.ui.warn, inst) 510 self.ui.warn(inst.format())
512 self.ui.flush() 511 self.ui.flush()
513 self.cresult.write(b'exit 255') 512 self.cresult.write(b'exit 255')
514 return 513 return
515 except error.Abort as inst: 514 except error.Abort as inst:
516 self.ui.error(_(b"abort: %s\n") % inst.message) 515 self.ui.error(_(b"abort: %s\n") % inst.message)