[PATCH] shelve: add -n/--name option to unshelve (issue5475)

Yuya Nishihara yuya at tcha.org
Sun Feb 19 08:53:42 EST 2017


On Sun, 19 Feb 2017 11:07:23 +0100, liscju wrote:
> # HG changeset patch
> # User liscju <piotr.listkiewicz at gmail.com>
> # Date 1487498168 -3600
> #      Sun Feb 19 10:56:08 2017 +0100
> # Node ID a645a60d15639f01892fc2887beff30193d09f20
> # Parent  01eebb65a61d9edcad1665ed747c7092f1ddb8b9
> shelve: add -n/--name option to unshelve (issue5475)
> 
> This makes using shelve/unshelve more consistent because
> shelving can be done using name option and unshelving as
> well. Author of the idea of this improvement and solution is
> joshgold.
> 
> diff --git a/hgext/shelve.py b/hgext/shelve.py
> --- a/hgext/shelve.py
> +++ b/hgext/shelve.py
> @@ -747,10 +747,12 @@ def _checkunshelveuntrackedproblems(ui, 
>             _('continue an incomplete unshelve operation')),
>            ('k', 'keep', None,
>             _('keep shelve after unshelving')),
> +          ('n', 'name', '',
> +           _('use the given name for the shelved commit'), _('NAME')),
>            ('t', 'tool', '', _('specify merge tool')),
>            ('', 'date', '',
>             _('set date for temporary commits (DEPRECATED)'), _('DATE'))],
> -         _('hg unshelve [SHELVED]'))
> +         _('hg unshelve [[-n] SHELVED]'))
>  def unshelve(ui, repo, *shelved, **opts):
>      """restore a shelved change to the working directory

You need to process opts.get('name').

> @@ -493,7 +493,7 @@ ensure that metadata-only changes are sh
>    $ ln -s foo a/a
>    $ hg shelve -q -n symlink a/a
>    $ hg status a/a
> -  $ hg unshelve -q symlink
> +  $ hg unshelve -q -n symlink

Perhaps it would unshelve the last change since -n option was discarded.


More information about the Mercurial-devel mailing list