[PATCH 11 of 11] revset: use `subset &` in bare `p2()`
Augie Fackler
raf at durin42.com
Wed Sep 24 17:14:07 UTC 2014
On Tue, Sep 23, 2014 at 03:47:57PM -0700, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at fb.com>
> # Date 1410976803 25200
> # Wed Sep 17 11:00:03 2014 -0700
> # Node ID 62f989f177ba1effe2b86833a1f0ca5715434675
> # Parent d2ac8f8e413275de8d61978f1653c8d1019e95da
> revset: use `subset &` in bare `p2()`
Queued the lot, with english tweaks in log messages.
>
> This take advantage of the `fullreposet` smartness with a nice speedup.
> Except similar speedup than for p1 when on a merge. (non merge are equally
> lightning fast anyway)
>
> diff --git a/mercurial/revset.py b/mercurial/revset.py
> --- a/mercurial/revset.py
> +++ b/mercurial/revset.py
> @@ -1215,11 +1215,13 @@ def p2(repo, subset, x):
> """
> if x is None:
> ps = repo[x].parents()
> try:
> p = ps[1].rev()
> - return subset.filter(lambda r: r == p)
> + if p >= 0:
> + return subset & baseset([p])
> + return baseset([])
> except IndexError:
> return baseset([])
>
> ps = set()
> cl = repo.changelog
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
More information about the Mercurial-devel
mailing list