--- 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):