changeset 42761:5c285c8e4f98

unshelve: abort on using --keep and --interactive together I am working on making interactive mode support `--keep` flag. Until we support the usage of `--interactive` and `--keep` together, let us abort on it. Differential Revision: https://phab.mercurial-scm.org/D6699
author Navaneeth Suresh <navaneeths1998@gmail.com>
date Thu, 15 Aug 2019 20:43:25 +0530
parents 9f2189b6bf2a
children ac6121a24f27
files mercurial/shelve.py tests/test-shelve.t
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/shelve.py	Tue Aug 20 18:35:16 2019 +0300
+++ b/mercurial/shelve.py	Thu Aug 15 20:43:25 2019 +0530
@@ -942,6 +942,8 @@
     if opts.get("name"):
         shelved.append(opts["name"])
 
+    if interactive and opts.get('keep'):
+        raise error.Abort(_('--keep on --interactive is not yet supported'))
     if abortf or continuef:
         if abortf and continuef:
             raise error.Abort(_('cannot use both abort and continue'))
--- a/tests/test-shelve.t	Tue Aug 20 18:35:16 2019 +0300
+++ b/tests/test-shelve.t	Thu Aug 15 20:43:25 2019 +0530
@@ -1475,3 +1475,7 @@
   record this change to 'bar2'?
   (enter ? for help) [Ynesfdaq?] y
   
+-- test for --interactive --keep
+  $ hg unshelve -i --keep
+  abort: --keep on --interactive is not yet supported
+  [255]