mercurial/shelve.py
changeset 51809 54b1a3738530
parent 51097 ae6722dbb575
child 51812 a1a94d488e14
--- a/mercurial/shelve.py	Tue Aug 20 11:18:10 2024 -0400
+++ b/mercurial/shelve.py	Tue Aug 20 16:32:13 2024 -0400
@@ -792,6 +792,7 @@
         state = shelvedstate.load(repo)
         if opts.get(b'keep') is None:
             opts[b'keep'] = state.keep
+        return state
     except FileNotFoundError:
         cmdutil.wrongtooltocontinue(repo, _(b'unshelve'))
     except error.CorruptedState as err:
@@ -812,7 +813,10 @@
                     b'please update to some commit\n'
                 )
             )
-    return state
+        else:
+            raise error.ProgrammingError(
+                "a corrupted shelvedstate exists without --abort or --continue"
+            )
 
 
 def unshelveabort(ui, repo, state):