[PATCH] revsets: add branchpoint() function

Pierre-Yves David pierre-yves.david at ens-lyon.org
Fri Oct 12 15:07:07 CDT 2012


On 13 août 2012, at 23:07, Ivan Andrus wrote:

> +    baserev = min(subset)
> +    parentscount = [0]*(len(repo) - baserev)
> +    for r in xrange(baserev + 1, len(repo)):
> +        for p in cl.parentrevs(r):

(1) Changelog filtering require to not use xrange here:
    should be for r in cl.revs(start=baserev+1)

(2) this implementation is subobtimal. Current complexity is

    O((baserev-len())²)

    The lower bound is:

    O(baserev-len())

Sorry for reviewing that late.

I'm +1 on the feature otherwise I though it was already in. If it is actually queued, this could be fixed by 2.4 release (is N² squashing suitable for freeze ?).

-- 
Pierre-Yves





More information about the Mercurial-devel mailing list