Show More
@@ -512,9 +512,7 b' class chgcmdserver(commandserver.server)' | |||
|
512 | 512 | self.cresult.write(b'exit 255') |
|
513 | 513 | return |
|
514 | 514 | except error.Abort as inst: |
|
515 |
self.ui.error( |
|
|
516 | if inst.hint: | |
|
517 | self.ui.error(_(b"(%s)\n") % inst.hint) | |
|
515 | self.ui.error(inst.format()) | |
|
518 | 516 | self.ui.flush() |
|
519 | 517 | self.cresult.write(b'exit 255') |
|
520 | 518 | return |
@@ -256,9 +256,7 b' def dispatch(req):' | |||
|
256 | 256 | if req.fmsg: |
|
257 | 257 | req.ui.fmsg = req.fmsg |
|
258 | 258 | except error.Abort as inst: |
|
259 |
ferr.write( |
|
|
260 | if inst.hint: | |
|
261 | ferr.write(_(b"(%s)\n") % inst.hint) | |
|
259 | ferr.write(inst.format()) | |
|
262 | 260 | return -1 |
|
263 | 261 | except error.ParseError as inst: |
|
264 | 262 | ferr.write(inst.format()) |
@@ -182,6 +182,14 b' class Abort(Hint, Exception):' | |||
|
182 | 182 | # may raise another exception. |
|
183 | 183 | return pycompat.sysstr(self.__bytes__()) |
|
184 | 184 | |
|
185 | def format(self): | |
|
186 | from .i18n import _ | |
|
187 | ||
|
188 | message = _(b"abort: %s\n") % self.message | |
|
189 | if self.hint: | |
|
190 | message += _(b"(%s)\n") % self.hint | |
|
191 | return message | |
|
192 | ||
|
185 | 193 | |
|
186 | 194 | class InputError(Abort): |
|
187 | 195 | """Indicates that the user made an error in their input. |
@@ -230,9 +230,7 b' def callcatch(ui, func):' | |||
|
230 | 230 | detailed_exit_code = 30 |
|
231 | 231 | elif isinstance(inst, error.CanceledError): |
|
232 | 232 | detailed_exit_code = 250 |
|
233 |
ui.error( |
|
|
234 | if inst.hint: | |
|
235 | ui.error(_(b"(%s)\n") % inst.hint) | |
|
233 | ui.error(inst.format()) | |
|
236 | 234 | except error.WorkerError as inst: |
|
237 | 235 | # Don't print a message -- the worker already should have |
|
238 | 236 | return inst.status_code |
@@ -685,9 +685,7 b' def unbundle(repo, proto, heads):' | |||
|
685 | 685 | # We did not change it to minimise code change. |
|
686 | 686 | # This need to be moved to something proper. |
|
687 | 687 | # Feel free to do it. |
|
688 |
procutil.stderr.write( |
|
|
689 | if exc.hint is not None: | |
|
690 | procutil.stderr.write(b"(%s)\n" % exc.hint) | |
|
688 | procutil.stderr.write(exc.format()) | |
|
691 | 689 | procutil.stderr.flush() |
|
692 | 690 | return wireprototypes.pushres( |
|
693 | 691 | 0, output.getvalue() if output else b'' |
General Comments 0
You need to be logged in to leave comments.
Login now