D9336: errors: raise InputError in `hg debugobsolete`

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Wed Nov 18 00:57:23 UTC 2020


martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9336

AFFECTED FILES
  mercurial/debugcommands.py
  tests/test-obsolete.t

CHANGE DETAILS

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 @@
 
   $ 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
diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -2250,7 +2250,7 @@
                 raise TypeError()
             return n
         except TypeError:
-            raise error.Abort(
+            raise error.InputError(
                 b'changeset references must be full hexadecimal '
                 b'node identifiers'
             )
@@ -2261,7 +2261,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'),
                 )
@@ -2279,7 +2279,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)



To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel


More information about the Mercurial-devel mailing list