Mercurial > public > mercurial-scm > hg
diff mercurial/scmutil.py @ 45845:f96fa4de5055
errors: use InputError for errors about bad label names (tags etc)
Differential Revision: https://phab.mercurial-scm.org/D9327
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 12 Nov 2020 10:35:33 -0800 |
parents | 3175b0e0058b |
children | 4b4160a83303 |
line wrap: on
line diff
--- a/mercurial/scmutil.py Thu Nov 12 09:53:14 2020 -0800 +++ b/mercurial/scmutil.py Thu Nov 12 10:35:33 2020 -0800 @@ -293,19 +293,21 @@ # Do not use the "kind" parameter in ui output. # It makes strings difficult to translate. if lbl in [b'tip', b'.', b'null']: - raise error.Abort(_(b"the name '%s' is reserved") % lbl) + raise error.InputError(_(b"the name '%s' is reserved") % lbl) for c in (b':', b'\0', b'\n', b'\r'): if c in lbl: - raise error.Abort( + raise error.InputError( _(b"%r cannot be used in a name") % pycompat.bytestr(c) ) try: int(lbl) - raise error.Abort(_(b"cannot use an integer as a name")) + raise error.InputError(_(b"cannot use an integer as a name")) except ValueError: pass if lbl.strip() != lbl: - raise error.Abort(_(b"leading or trailing whitespace in name %r") % lbl) + raise error.InputError( + _(b"leading or trailing whitespace in name %r") % lbl + ) def checkfilename(f):