changeset 25799:0eb093e40813

shelve: omit incorrect 'commit' suggestion at 'hg shelve -i' Before this patch, 'hg shelve -i' under non-interactive mode suggests 'use commit instead', and it obviously incorrect, because what user wants to do isn't 'commit' but 'shelve'. To omit incorrect 'commit' suggestion at 'hg shelve -i', this patch specifies 'None' for 'cmdsuggest' argument of 'cmdutil.dorecord()'.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 15 Jul 2015 04:45:58 +0900
parents 08f2177b15c7
children f8f7ae0f4d98
files hgext/shelve.py tests/test-shelve.t
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/shelve.py	Wed Jul 15 04:45:58 2015 +0900
+++ b/hgext/shelve.py	Wed Jul 15 04:45:58 2015 +0900
@@ -279,7 +279,7 @@
         if not interactive:
             node = cmdutil.commit(ui, repo, commitfunc, pats, opts)
         else:
-            node = cmdutil.dorecord(ui, repo, interactivecommitfunc, 'commit',
+            node = cmdutil.dorecord(ui, repo, interactivecommitfunc, None,
                                     False, cmdutil.recordfilter, *pats, **opts)
         if not node:
             stat = repo.status(match=scmutil.match(repo[None], pats, opts))
--- a/tests/test-shelve.t	Wed Jul 15 04:45:58 2015 +0900
+++ b/tests/test-shelve.t	Wed Jul 15 04:45:58 2015 +0900
@@ -860,6 +860,9 @@
   $ cat foo/foo
   foo
   a
+  $ hg shelve --interactive --config ui.interactive=false
+  abort: running non-interactively
+  [255]
   $ hg shelve --interactive << EOF
   > y
   > y