[PATCH 1 of 5 V2] revset: make children only look at commits >= minrev

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed Oct 1 15:21:09 CDT 2014



On 09/30/2014 01:02 PM, Durham Goode wrote:
> # HG changeset patch
> # User Durham Goode <durham at fb.com>
> # Date 1411450748 25200
> #      Mon Sep 22 22:39:08 2014 -0700
> # Node ID c6129c781a9f11be26191e64dcebf8d539c8c76a
> # Parent  939ce500c92a3dcc0e10815242361ff70a6fcae9
> revset: make children only look at commits >= minrev

The change make to children revealed that  3.0 introduced a massive 
regression in revset ordering so a massive rework of revset is coming). 
This series will no apply anymore after this refactoring. I'm giving 
feedback on it to help getting a V3 out when appropriate

>
> Previously children() would iterate over every item in the subset, looking for
> children of things in the parentset. We now request that the subset present
> itself in descending order, so we can abort early once we see a rev that is <=
> the minimum parent.
>
> This patch alone doesn't change perf much, but combined with a future patch to
> __and__ semantics, it drops rebase perf by about 40%.
>
> diff --git a/mercurial/revset.py b/mercurial/revset.py
> --- a/mercurial/revset.py
> +++ b/mercurial/revset.py
> @@ -561,9 +561,10 @@ def _children(repo, narrow, parentset):
>           return baseset(cs)
>       pr = repo.changelog.parentrevs
>       minrev = min(parentset)
> +    narrow.descending()

Please use narrow.sort(reverse=True) the existence of ascending and 
descending (instead of plain sort usage) is a non-sense that I'm trying 
to get ride of.

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list