Patchwork D6703: unshelve: add abort on using continue and interactive together

login
register
mail settings
Submitter phabricator
Date July 31, 2019, 11:46 p.m.
Message ID <8e1e72ad37c3f2f83a8dac1da2251343@localhost.localdomain>
Download mbox | patch
Permalink /patch/41104/
State Not Applicable
Headers show

Comments

phabricator - July 31, 2019, 11:46 p.m.
Closed by commit rHG52a383451739: unshelve: add abort on using continue and interactive together (authored by navaneeth.suresh).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6703?vs=16095&id=16098

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6703/new/

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

Patch

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: