[PATCH] shelve: allow multiple shelves with --patch and --stat

Anton Shestakov av6 at dwimlabs.net
Sat Jan 14 01:09:37 EST 2017


On Sat, 14 Jan 2017 01:27:13 +0530
Pulkit Goyal <7895pulkit at gmail.com> wrote:

> # HG changeset patch
> # User Pulkit Goyal <7895pulkit at gmail.com>
> # Date 1484337187 -19800
> #      Sat Jan 14 01:23:07 2017 +0530
> # Node ID 9dc4d056d85a041b2b28587b3b84608b1f0903a5
> # Parent  e9bc34f57537249115de4de5c0990365ef65298e
> shelve: allow multiple shelves with --patch and --stat
> 
> Before this patch, there was a single way to see multiple shelves using
> `--patch --list` which show all the shelves. Doing `--patch s1 s2` returns an
> error. This patch allows to show multiple shelves using `--patch` and `--stat`.

Sure...

> diff -r e9bc34f57537 -r 9dc4d056d85a hgext/shelve.py
> --- a/hgext/shelve.py	Sun Jan 08 10:08:29 2017 +0800
> +++ b/hgext/shelve.py	Sat Jan 14 01:23:07 2017 +0530
> @@ -523,13 +523,13 @@
>                      ui.write(chunk, label=label)
>  
>  def singlepatchcmds(ui, repo, pats, opts, subcommand):

...but then it's not about "single patch" anymore.

> -    """subcommand that displays a single shelf"""
> -    if len(pats) != 1:
> -        raise error.Abort(_("--%s expects a single shelf") % subcommand)
> -    shelfname = pats[0]
> +    """subcommand that displays shelves"""
> +    if len(pats) == 0:
> +        raise error.Abort(_("--%s expects atleast one shelf") % subcommand)

"At least."


More information about the Mercurial-devel mailing list