Mercurial > public > mercurial-scm > hg
comparison mercurial/scmutil.py @ 47295:dd339191f2dc
errors: make StorageError subclass Error, attaching an exit code to it
Differential Revision: https://phab.mercurial-scm.org/D10741
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 18 May 2021 21:50:09 -0700 |
parents | 7a769ac49637 |
children | 0f5c203eb5ab |
comparison
equal
deleted
inserted
replaced
47294:93a0abe098e7 | 47295:dd339191f2dc |
---|---|
196 ui.error(_(b" empty string\n")) | 196 ui.error(_(b" empty string\n")) |
197 else: | 197 else: |
198 ui.error(b"\n%r\n" % pycompat.bytestr(stringutil.ellipsis(msg))) | 198 ui.error(b"\n%r\n" % pycompat.bytestr(stringutil.ellipsis(msg))) |
199 except error.CensoredNodeError as inst: | 199 except error.CensoredNodeError as inst: |
200 ui.error(_(b"abort: file censored %s\n") % inst) | 200 ui.error(_(b"abort: file censored %s\n") % inst) |
201 except error.StorageError as inst: | |
202 ui.error(_(b"abort: %s\n") % inst) | |
203 if inst.hint: | |
204 ui.error(_(b"(%s)\n") % inst.hint) | |
205 detailed_exit_code = 50 | |
206 except error.WdirUnsupported: | 201 except error.WdirUnsupported: |
207 ui.error(_(b"abort: working directory revision cannot be specified\n")) | 202 ui.error(_(b"abort: working directory revision cannot be specified\n")) |
208 except error.Error as inst: | 203 except error.Error as inst: |
209 if inst.detailed_exit_code is not None: | 204 if inst.detailed_exit_code is not None: |
210 detailed_exit_code = inst.detailed_exit_code | 205 detailed_exit_code = inst.detailed_exit_code |