changeset 45889:1a72e4839795

errors: raise InputError in `hg debugobsolete` Differential Revision: https://phab.mercurial-scm.org/D9336
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 17 Nov 2020 15:37:18 -0800
parents c8860a212770
children e641bb2a6159
files mercurial/debugcommands.py tests/test-obsolete.t
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Mon Nov 16 16:25:04 2020 -0800
+++ b/mercurial/debugcommands.py	Tue Nov 17 15:37:18 2020 -0800
@@ -2253,7 +2253,7 @@
                 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 @@
             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 @@
 
     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)
--- a/tests/test-obsolete.t	Mon Nov 16 16:25:04 2020 -0800
+++ b/tests/test-obsolete.t	Tue Nov 17 15:37:18 2020 -0800
@@ -47,10 +47,10 @@
 
   $ 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