changeset 6262:b4e1d34ad1e9

pick: use compat.StateError for missing state file
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 23 Mar 2022 00:02:14 +0300
parents a2491c578d2b
children 889d21445ee9
files hgext3rd/evolve/cmdrewrite.py tests/test-pick.t
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/cmdrewrite.py	Tue May 24 10:24:36 2022 +0400
+++ b/hgext3rd/evolve/cmdrewrite.py	Wed Mar 23 00:02:14 2022 +0300
@@ -1367,7 +1367,7 @@
                 raise error.Abort(_(b"cannot specify both --continue and "
                                     b"revision"))
             if not pickstate:
-                raise error.Abort(_(b"no interrupted pick state exists"))
+                raise compat.StateError(_(b"no interrupted pick state exists"))
 
             pickstate.load()
             orignode = pickstate[b'orignode']
@@ -1442,7 +1442,7 @@
 def abortpick(ui, repo, pickstate, abortcmd=False):
     """logic to abort pick"""
     if not pickstate and not abortcmd:
-        raise error.Abort(_(b"no interrupted pick state exists"))
+        raise compat.StateError(_(b"no interrupted pick state exists"))
     pickstate.load()
     pctxnode = pickstate[b'oldpctx']
     compat.clean_update(repo[pctxnode])
--- a/tests/test-pick.t	Tue May 24 10:24:36 2022 +0400
+++ b/tests/test-pick.t	Wed Mar 23 00:02:14 2022 +0300
@@ -83,7 +83,7 @@
 
   $ hg pick --continue
   abort: no interrupted pick state exists
-  [255]
+  [20]
 #if abortcontinuecommand
   $ hg continue
   abort: no operation in progress
@@ -94,7 +94,7 @@
 
   $ hg pick --abort
   abort: no interrupted pick state exists
-  [255]
+  [20]
 #if abortcontinuecommand
   $ hg abort
   abort: no operation in progress