[PATCH 2 of 3] graphmod: stop building a list out of branchgroupiter

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu Aug 27 14:25:27 CDT 2015


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1440198205 25200
#      Fri Aug 21 16:03:25 2015 -0700
# Node ID df0a203aa014a3afe3e4c4aa5fc9033e65fcb8c9
# Parent  c8a380090773ed60d31d8f8b4e01bbac797688b0
graphmod: stop building a list out of branchgroupiter

Not only this defeat the purpose of having `branchgroupiter` an iterable, but
this also makes revs something else than a smartset preventing to use revs.min()
in the call to reachablerevs.

diff --git a/mercurial/graphmod.py b/mercurial/graphmod.py
--- a/mercurial/graphmod.py
+++ b/mercurial/graphmod.py
@@ -245,11 +245,12 @@ def dagwalker(repo, revs):
         firstbranchrevset = repo.ui.config(
             'experimental', 'graph-group-branches.firstbranch', '')
         if firstbranchrevset:
             firstbranch = repo.revs(firstbranchrevset)
         parentrevs = repo.changelog.parentrevs
-        revs = list(groupbranchiter(revs, parentrevs, firstbranch))
+        revs = groupbranchiter(revs, parentrevs, firstbranch)
+        revs = revset.generatorset(revs)
 
     for rev in revs:
         ctx = repo[rev]
         parents = sorted(set([p.rev() for p in ctx.parents()
                               if p.rev() in revs]))


More information about the Mercurial-devel mailing list