Mercurial > hg-stable
changeset 24477:325f03de849d
shelve: add interactive mode command line option
author | Laurent Charignon <lcharignon@fb.com> |
---|---|
date | Wed, 25 Mar 2015 15:52:28 -0700 |
parents | 1378f20c8564 |
children | 95cbc77c0cad |
files | hgext/shelve.py tests/test-shelve.t |
diffstat | 2 files changed, 54 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/shelve.py Wed Mar 25 15:51:57 2015 -0700 +++ b/hgext/shelve.py Wed Mar 25 15:52:28 2015 -0700 @@ -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]...'))
--- a/tests/test-shelve.t Wed Mar 25 15:51:57 2015 -0700 +++ b/tests/test-shelve.t Wed Mar 25 15:52:28 2015 -0700 @@ -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)