diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -2253,7 +2253,7 @@ def debugobsolete(ui, repo, precursor=No raise TypeError() return n except TypeError: - raise error.Abort( + raise error.InputError( b'changeset references must be full hexadecimal ' b'node identifiers' ) @@ -2264,7 +2264,7 @@ def debugobsolete(ui, repo, precursor=No try: indices.append(int(v)) except ValueError: - raise error.Abort( + raise error.InputError( _(b'invalid index value: %r') % v, hint=_(b'use integers for indices'), ) @@ -2282,7 +2282,9 @@ def debugobsolete(ui, repo, precursor=No if precursor is not None: if opts[b'rev']: - raise error.Abort(b'cannot select revision when creating marker') + raise error.InputError( + b'cannot select revision when creating marker' + ) metadata = {} metadata[b'user'] = encoding.fromlocal(opts[b'user'] or ui.username()) succs = tuple(parsenodeid(succ) for succ in successors) diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t --- a/tests/test-obsolete.t +++ b/tests/test-obsolete.t @@ -47,10 +47,10 @@ Killing a single changeset without repla $ hg debugobsolete 0 abort: changeset references must be full hexadecimal node identifiers - [255] + [10] $ hg debugobsolete '00' abort: changeset references must be full hexadecimal node identifiers - [255] + [10] $ hg debugobsolete -d '0 0' `getid kill_me` -u babar 1 new obsolescence markers obsoleted 1 changesets