comparison mercurial/scmutil.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 1817b66897ad
children 600aec73f309
comparison
equal deleted inserted replaced
45883:1817b66897ad 45884:98399dd1b96c
138 _(b"no changes found (ignored %d secret changesets)\n") 138 _(b"no changes found (ignored %d secret changesets)\n")
139 % len(secretlist) 139 % len(secretlist)
140 ) 140 )
141 else: 141 else:
142 ui.status(_(b"no changes found\n")) 142 ui.status(_(b"no changes found\n"))
143
144
145 def formatparse(write, inst):
146 if inst.location is not None:
147 write(
148 _(b"hg: parse error at %s: %s\n")
149 % (pycompat.bytestr(inst.location), inst.message)
150 )
151 else:
152 write(_(b"hg: parse error: %s\n") % inst.message)
153 if inst.hint:
154 write(_(b"(%s)\n") % inst.hint)
155 143
156 144
157 def callcatch(ui, func): 145 def callcatch(ui, func):
158 """call func() with global exception handling 146 """call func() with global exception handling
159 147