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

navaneeth.suresh (Navaneeth Suresh) phabricator at mercurial-scm.org
Sat Aug 17 16:41:10 EDT 2019


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

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'))



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


More information about the Mercurial-devel mailing list