Patchwork D6739: unshelve: add abort on using --interactive and --unresolved together

login
register
mail settings
Submitter phabricator
Date Aug. 17, 2019, 8:41 p.m.
Message ID <differential-rev-PHID-DREV-tmmakokap66tqltd2b2r-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/41342/
State New
Headers show

Comments

phabricator - Aug. 17, 2019, 8:41 p.m.
navaneeth.suresh created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  It seems not to be a good idea to partially unshelve a mergestate. So,
  let us abort on using `--interactive` and `--unresolved` together.`

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6739

AFFECTED FILES
  mercurial/shelve.py
  tests/test-shelve-unresolved.t

CHANGE DETAILS




To: navaneeth.suresh, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-shelve-unresolved.t b/tests/test-shelve-unresolved.t
--- a/tests/test-shelve-unresolved.t
+++ b/tests/test-shelve-unresolved.t
@@ -220,6 +220,11 @@ 
   A
   C
 
+-- abort on using both --interactive and --unresolved
+  $ hg unshelve --unresolved --interactive
+  abort: cannot use both interactive and unresolved
+  [255]
+
 -- flag --unshelve is not passed. but, the last shelve is unresolved
   $ hg unshelve
   unshelving change 'default'
diff --git a/mercurial/shelve.py b/mercurial/shelve.py
--- a/mercurial/shelve.py
+++ b/mercurial/shelve.py
@@ -1008,6 +1008,8 @@ 
 
     if interactive and opts.get('keep'):
         raise error.Abort(_('--keep on --interactive is not yet supported'))
+    if interactive and unresolved:
+        raise error.Abort(_('cannot use both interactive and unresolved'))
     if abortf or continuef:
         if abortf and continuef:
             raise error.Abort(_('cannot use both abort and continue'))