From patchwork Tue Jul 30 16:10:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D6703: unshelve: add abort on using continue and interactive together From: phabricator X-Patchwork-Id: 41100 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Tue, 30 Jul 2019 16:10:18 +0000 navaneeth.suresh created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY `unshelve --continue --interactive` will not work as expected by the user as the mode of in-progress unshelve is preserved and cannot be overwritten. This patch makes `unshelve` to throw an error on using both `--continue` and `--interactive` together with `unshelve`. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6703 AFFECTED FILES mercurial/shelve.py tests/test-shelve.t CHANGE DETAILS To: navaneeth.suresh, #hg-reviewers Cc: mercurial-devel diff --git a/tests/test-shelve.t b/tests/test-shelve.t --- a/tests/test-shelve.t +++ b/tests/test-shelve.t @@ -1347,6 +1347,12 @@ $ hg resolve -m bar1 bar2 (no more unresolved files) continue: hg unshelve --continue + +-- using --continue with --interactive should throw an error + $ hg unshelve --continue -i + abort: cannot use both continue and interactive + [255] + $ cat bar1 A B diff --git a/mercurial/shelve.py b/mercurial/shelve.py --- a/mercurial/shelve.py +++ b/mercurial/shelve.py @@ -954,6 +954,8 @@ state = _loadshelvedstate(ui, repo, opts) if abortf: return unshelveabort(ui, repo, state) + elif continuef and interactive: + raise error.Abort(_('cannot use both continue and interactive')) elif continuef: return unshelvecontinue(ui, repo, state, opts) elif len(shelved) > 1: