[PATCH V2] dagwalker: drop an useless intermediate variable

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed Oct 15 15:13:22 CDT 2014


# 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

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)


More information about the Mercurial-devel mailing list