[PATCH 4 of 4 evolve-ext] fold: rehaul handling of multiple and single revisions (BC)

Martin Geisler martin at geisler.net
Sat Apr 12 04:13:20 CDT 2014


Jordi Gutiérrez Hermoso <jordigh at octave.org> writes:

> # HG changeset patch
> # User Jordi Gutiérrez Hermoso <jordigh at octave.org>
> # Date 1397267702 14400
> #      Fri Apr 11 21:55:02 2014 -0400
> # Branch stable
> # Node ID 9c091f86aa395a09e81771f7967ce314e4aeb6ce
> # Parent  625907cf8d34b3fb8086db6131ef22724c2045be
> fold: rehaul handling of multiple and single revisions (BC)
>
> The fold command parsed the revision arguments in a very peculiar and
> idiosyncratic fashion: either a single revision could be specified or
> multiple revisions could be specified with --rev (but not both). This
> is inconsistent with the way all other hg commands parse revision
> arguments. We have several examples of command where several revisions
> are passed, and the --rev option is optional for specifying those
> revisions (update, strip, export).
>
> This patch alters the way in which fold parses its revision arguments.
> No distinction is made between revisions passed with or without the
> --rev argument. If a single revision is passed, then as before, all
> commits betwen the current commit and the target revision are folded
> into one. If multiple revisions are specified, they must specify a
> unique contiguous line.
>
> The docstring and error messages are modified accordingly, as well as
> the tests.
>
> diff --git a/hgext/evolve.py b/hgext/evolve.py
> --- a/hgext/evolve.py
> +++ b/hgext/evolve.py
> @@ -1716,41 +1716,47 @@
>          lockmod.release(lock, wlock)
>  
>  @command('^fold|squash',
> -    [('r', 'rev', [], _("explicitly specify the full set of revision to fold")),
> +    [('r', 'rev', [], _("revision(s) to fold")),

We normally don't use use the (s) style for things that can be plural.
For options, the help system will add a "[+]" to flags that can be
specified multiple times.

For --rev in particular, 'hg log' talk about revision in singular,
though one can specify multiple revisions using a single --rev flag.

-- 
Martin Geisler

http://google.com/+MartinGeisler
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20140412/53a0d2b3/attachment.pgp>


More information about the Mercurial-devel mailing list