[Updated] D9336: errors: raise InputError in `hg debugobsolete`

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Thu Nov 19 18:02:42 UTC 2020


Closed by commit rHGa8662df13efe: errors: raise InputError in `hg debugobsolete` (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D9336?vs=23531&id=23559

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D9336/new/

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
@@ -2252,7 +2252,7 @@
                 raise TypeError()
             return n
         except TypeError:
-            raise error.Abort(
+            raise error.InputError(
                 b'changeset references must be full hexadecimal '
                 b'node identifiers'
             )
@@ -2263,7 +2263,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'),
                 )
@@ -2281,7 +2281,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, mharbison72
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20201119/5876615d/attachment-0002.html>


More information about the Mercurial-patches mailing list