changeset 42598:8ddfdcce4bd6

unshelve: changed Corruptedstate error msg from ui.warn to error.Abort This changes the message type of Corruptedstate error in case of `hg unshelve --abort` to error.Abort from warning message. This is done so as to avoid the return statement after the warning. Differential Revision: https://phab.mercurial-scm.org/D6636
author Taapas Agrawal <taapas2897@gmail.com>
date Wed, 10 Jul 2019 23:11:55 +0530
parents 51e52a495214
children 3fb0493812c0
files mercurial/shelve.py tests/test-shelve2.t
diffstat 2 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/shelve.py	Thu Jun 20 01:08:56 2019 +0530
+++ b/mercurial/shelve.py	Wed Jul 10 23:11:55 2019 +0530
@@ -880,12 +880,10 @@
                          'operation')
                 raise error.Abort(msg, hint=hint)
             elif abortf:
-                msg = _('could not read shelved state file, your working copy '
-                        'may be in an unexpected state\nplease update to some '
-                        'commit\n')
-                ui.warn(msg)
                 shelvedstate.clear(repo)
-            return
+                raise error.Abort(_('could not read shelved state file, your '
+                                 'working copy may be in an unexpected state\n'
+                                 'please update to some commit\n'))
 
         if abortf:
             return unshelveabort(ui, repo, state, opts)
--- a/tests/test-shelve2.t	Thu Jun 20 01:08:56 2019 +0530
+++ b/tests/test-shelve2.t	Wed Jul 10 23:11:55 2019 +0530
@@ -696,8 +696,10 @@
 
 Unshelve --abort works with a corrupted shelvedstate
   $ hg unshelve --abort
-  could not read shelved state file, your working copy may be in an unexpected state
+  abort: could not read shelved state file, your working copy may be in an unexpected state
   please update to some commit
+  
+  [255]
 
 Unshelve --abort fails with appropriate message if there's no unshelve in
 progress