[PATCH V2] dagwalker: drop an useless intermediate variable

Augie Fackler raf at durin42.com
Fri Oct 17 09:25:05 CDT 2014


On Wed, Oct 15, 2014 at 01:13:22PM -0700, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at fb.com>
> # Date 1412761431 25200
> #      Wed Oct 08 02:43:51 2014 -0700
> # Node ID 374b51d2d4a050eec3dbacf79a41fe21a9ac571a
> # Parent  75d0edb68b417964110e3fcd69187c867f31a119
> dagwalker: drop an useless intermediate variable

queued, thanks

>
> The variable used to contains revs.set() but as the `.set()` have been removed
> it is now useless.
>
> diff --git a/mercurial/graphmod.py b/mercurial/graphmod.py
> --- a/mercurial/graphmod.py
> +++ b/mercurial/graphmod.py
> @@ -35,15 +35,14 @@ def dagwalker(repo, revs):
>
>      cl = repo.changelog
>      lowestrev = revs.min()
>      gpcache = {}
>
> -    knownrevs = revs
>      for rev in revs:
>          ctx = repo[rev]
>          parents = sorted(set([p.rev() for p in ctx.parents()
> -                              if p.rev() in knownrevs]))
> +                              if p.rev() in revs]))
>          mpars = [p.rev() for p in ctx.parents() if
>                   p.rev() != nullrev and p.rev() not in parents]
>
>          for mpar in mpars:
>              gp = gpcache.get(mpar)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list