# HG changeset patch # User Taapas Agrawal # Date 2019-07-10 17:41:55 # Node ID 8ddfdcce4bd603efe4f8f5620773bbee1f3b1bb5 # Parent 51e52a495214639feb1c49f5c4ff98d9779d1aad 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 diff --git a/mercurial/shelve.py b/mercurial/shelve.py --- a/mercurial/shelve.py +++ b/mercurial/shelve.py @@ -880,12 +880,10 @@ def dounshelve(ui, repo, *shelved, **opt '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) diff --git a/tests/test-shelve2.t b/tests/test-shelve2.t --- a/tests/test-shelve2.t +++ b/tests/test-shelve2.t @@ -696,8 +696,10 @@ Unshelve --continue fails with appropria 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