diff hgext/transplant.py @ 45840:527ce85c2e60

errors: introduce StateError and use it from commands and cmdutil This very similar to an earlier patch (which was for `InputError`). In this patch, I also updated the transplant extension only because `test-transplant.t` would otherwise have needed a `#if continueflag`. Differential Revision: https://phab.mercurial-scm.org/D9310
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 12 Oct 2020 12:44:18 -0700
parents c1b603cdc95a
children 89a2afe31e82
line wrap: on
line diff
--- a/hgext/transplant.py	Thu Oct 22 13:31:34 2020 -0700
+++ b/hgext/transplant.py	Mon Oct 12 12:44:18 2020 -0700
@@ -804,10 +804,10 @@
         raise error.Abort(_(b'no revision checked out'))
     if opts.get(b'continue'):
         if not tp.canresume():
-            raise error.Abort(_(b'no transplant to continue'))
+            raise error.StateError(_(b'no transplant to continue'))
     elif opts.get(b'stop'):
         if not tp.canresume():
-            raise error.Abort(_(b'no interrupted transplant found'))
+            raise error.StateError(_(b'no interrupted transplant found'))
         return tp.stop(ui, repo)
     else:
         cmdutil.checkunfinished(repo)