[PATCH 5 of 5 evolve-ext] evolve: make --rev solve only unstability by default

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed May 13 19:18:09 CDT 2015



On 05/13/2015 10:04 AM, Laurent Charignon wrote:
> # HG changeset patch
> # User Laurent Charignon <lcharignon at fb.com>
> # Date 1431536286 25200
> #      Wed May 13 09:58:06 2015 -0700
> # Node ID 30d386135d2e02b676a58926250247011461d131
> # Parent  f7b2e0e5e05e76d181c99e6ed3fbcc9508cc0c33
> evolve: make --rev solve only unstability by default
>
> Before this patch evolve --rev was solving all the troubles in the
> specified revision. This patch restricts it to unstable only as this is
> generally what people expect to happen. The --bumped and --divergent flags
> can be used to have the same behavior than before and solve all of the
> troubles.
>
> diff --git a/hgext/evolve.py b/hgext/evolve.py
> --- a/hgext/evolve.py
> +++ b/hgext/evolve.py
> @@ -1242,7 +1242,8 @@
>        ('', 'confirm', False,
>           'ask for confirmation before performing the action'),
>       ('A', 'any', False, 'also consider troubled changesets unrelated to current working directory'),
> -    ('r', 'rev', '', 'solves troubles of these revisions'),
> +    ('r', 'rev', '', 'solves troubles of these revisions, only solve unstable by default'
> +        'use --bumped or --divergent to also solve bumped and divergent'),
>       ('', 'bumped', False, 'with --rev: solves only bumped changesets'),
>       ('', 'divergent', False, 'with --rev: solves only divergent changesets'),
>       ('', 'unstable', False, 'with --rev: solves only unstable changesets'),
> @@ -1273,6 +1274,11 @@
>
>       With --any, evolve picks any troubled changeset to repair.
>
> +    With --rev, one can choose to solve troubles in a specified revset:
> +
> +    - hg evolve --rev <revset> --divergent will only solve divergence in the specified revset
> +    - hg evolve --rev <revset> --divergent --unstable will solve divergence and unstability in the specified revset
> +    - hg evolve --rev <revset>  will only solve unstability in the specified revset
>       The working directory is updated to the newly created revision.
>       """
>
> @@ -1313,7 +1319,7 @@
>           if specifictypes:
>               troubled = repo.revs(' or '.join(specifictypes))
>           else:
> -            troubled = repo.revs('troubled()')
> +            troubled = repo.revs('unstable()')

You could (should?) still select all 'troubled()' changeset but skip 
solving the other troubles.

>           _revs = revs & troubled
>           if not _revs:
>               ui.write_err("No troubled changes in the specified revset\n")
> diff --git a/tests/test-evolve.t b/tests/test-evolve.t
> --- a/tests/test-evolve.t
> +++ b/tests/test-evolve.t
> @@ -946,7 +946,7 @@
>     |/
>     o  0	: a0 - test
>
> -  $ hg evolve -r 12
> +  $ hg evolve -r 12 --bumped
>     recreate:[12] add new file bumped
>     atop:[11] a2
>     computing new diff
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list