# HG changeset patch # User FUJIWARA Katsunori # Date 2013-10-28 16:03:43 # Node ID 6f29cc567845cbc819c90718b64566b6b0d26062 # Parent 66b21ce60a19287afdcbda8b3a0540a22f8a9535 shelve: disallow commit while unshelve is in progress Before this patch, commit is allowed even while unshelve is in progress. In the other hand, "hg unshelve --abort" and "hg unshelve --continue" check whether parent revisions of the working directory have changed or not since last "hg unshelve", and abort without clearing state for unshelve in progress if they have. This causes that accidental commit makes clearing state for unshelve difficult in ordinary ways. This patch disallows commit while unshelve is in progress for consistency. diff --git a/hgext/shelve.py b/hgext/shelve.py --- a/hgext/shelve.py +++ b/hgext/shelve.py @@ -704,5 +704,6 @@ def shelvecmd(ui, repo, *pats, **opts): def extsetup(ui): cmdutil.unfinishedstates.append( - [shelvedstate._filename, False, True, _('unshelve already in progress'), + [shelvedstate._filename, False, False, + _('unshelve already in progress'), _("use 'hg unshelve --continue' or 'hg unshelve --abort'")]) diff --git a/tests/test-shelve.t b/tests/test-shelve.t --- a/tests/test-shelve.t +++ b/tests/test-shelve.t @@ -303,6 +303,11 @@ attempt to continue $ hg revert -r . a/a $ hg resolve -m a/a + $ hg commit -m 'commit while unshelve in progress' + abort: unshelve already in progress + (use 'hg unshelve --continue' or 'hg unshelve --abort') + [255] + $ hg unshelve -c unshelve of 'default' complete