Patchwork [2,of,3] shelve: add interactive mode command line option

login
register
mail settings
Submitter Laurent Charignon
Date March 25, 2015, 11:12 p.m.
Message ID <1d83cdf817f4b43ec6e3.1427325125@dev919.prn2.facebook.com>
Download mbox | patch
Permalink /patch/8271/
State Superseded
Commit 95cbc77c0cad04b04bd690bb3ba91e919e11d3b1
Headers show

Comments

Laurent Charignon - March 25, 2015, 11:12 p.m.
# HG changeset patch
# User Laurent Charignon <lcharignon@fb.com>
# Date 1427323948 25200
#      Wed Mar 25 15:52:28 2015 -0700
# Node ID 1d83cdf817f4b43ec6e3fb4dd273a97ee6de5fc6
# Parent  9742d0246c2039885c1b17c7ab70df95b115e789
shelve: add interactive mode command line option

Patch

diff --git a/hgext/shelve.py b/hgext/shelve.py
--- a/hgext/shelve.py
+++ b/hgext/shelve.py
@@ -226,6 +226,7 @@ 
             raise util.Abort(_('shelved change names may not contain slashes'))
         if name.startswith('.'):
             raise util.Abort(_("shelved change names may not start with '.'"))
+        interactive = opts.get('interactive', False)
 
         node = cmdutil.commit(ui, repo, commitfunc, pats, opts)
 
@@ -649,6 +650,8 @@ 
            _('use the given name for the shelved commit'), _('NAME')),
           ('p', 'patch', None,
            _('show patch')),
+          ('i', 'interactive', None,
+           _('interactive mode, only works while creating a shelve')),
           ('', 'stat', None,
            _('output diffstat-style summary of changes'))] + commands.walkopts,
          _('hg shelve [OPTION]... [FILE]...'))
diff --git a/tests/test-shelve.t b/tests/test-shelve.t
--- a/tests/test-shelve.t
+++ b/tests/test-shelve.t
@@ -17,6 +17,57 @@ 
   $ echo x > x
   $ hg addremove -q
 
+shelve has a help message
+  $ hg shelve -h
+  hg shelve [OPTION]... [FILE]...
+  
+  save and set aside changes from the working directory
+  
+      Shelving takes files that "hg status" reports as not clean, saves the
+      modifications to a bundle (a shelved change), and reverts the files so
+      that their state in the working directory becomes clean.
+  
+      To restore these changes to the working directory, using "hg unshelve";
+      this will work even if you switch to a different commit.
+  
+      When no files are specified, "hg shelve" saves all not-clean files. If
+      specific files or directories are named, only changes to those files are
+      shelved.
+  
+      Each shelved change has a name that makes it easier to find later. The
+      name of a shelved change defaults to being based on the active bookmark,
+      or if there is no active bookmark, the current named branch.  To specify a
+      different name, use "--name".
+  
+      To see a list of existing shelved changes, use the "--list" option. For
+      each shelved change, this will print its name, age, and description; use "
+      --patch" or "--stat" for more details.
+  
+      To delete specific shelved changes, use "--delete". To delete all shelved
+      changes, use "--cleanup".
+  
+  (use "hg help -e shelve" to show help for the shelve extension)
+  
+  options ([+] can be repeated):
+  
+   -A --addremove           mark new/missing files as added/removed before
+                            shelving
+      --cleanup             delete all shelved changes
+      --date DATE           shelve with the specified commit date
+   -d --delete              delete the named shelved change(s)
+   -e --edit                invoke editor on commit messages
+   -l --list                list current shelves
+   -m --message TEXT        use text as shelve message
+   -n --name NAME           use the given name for the shelved commit
+   -p --patch               show patch
+   -i --interactive         interactive mode, only works while creating a shelve
+      --stat                output diffstat-style summary of changes
+   -I --include PATTERN [+] include names matching the given patterns
+   -X --exclude PATTERN [+] exclude names matching the given patterns
+      --mq                  operate on patch repository
+  
+  (some details hidden, use --verbose to show complete help)
+
 shelving in an empty repo should be possible
 (this tests also that editor is not invoked, if '--edit' is not
 specified)