[PATCH 3 of 5] transplant: use set for prune lookup

Augie Fackler raf at durin42.com
Wed Apr 17 08:59:01 CDT 2013


On Tue, Apr 16, 2013 at 07:49:09PM +0200, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski at unity3d.com>
> # Date 1366133519 -7200
> #      Tue Apr 16 19:31:59 2013 +0200
> # Node ID 3f621c427c998d049888ab60e6f40b7258f9f65f
> # Parent  7b1520771113094fdbe19511ef7ef22f2d2666f2
> transplant: use set for prune lookup

Before/after perf numbers? For small sets sometimes the list can be
better than the set? Does fb care about this, and maybe they have a
performance dashboard for it?

>
> diff --git a/hgext/transplant.py b/hgext/transplant.py
> --- a/hgext/transplant.py
> +++ b/hgext/transplant.py
> @@ -633,8 +633,8 @@
>
>          tf = tp.transplantfilter(repo, source, p1)
>          if opts.get('prune'):
> -            prune = [source.lookup(r)
> -                     for r in scmutil.revrange(source, opts.get('prune'))]
> +            prune = set(source.lookup(r)
> +                        for r in scmutil.revrange(source, opts.get('prune')))
>              matchfn = lambda x: tf(x) and x not in prune
>          else:
>              matchfn = tf
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list