Mercurial > hg
diff mercurial/graphmod.py @ 23565:996c01bfbec4
graphlog: add a way to test the 'groupbranchiter' function
We add an experimental config option to use the topological sorting. I first
tried to hook the 'groupbranchiter' function in the 'sort' revset but this was useless
because graphlog enforces revision number sorting :(
As the goal is to advance on the topological iteration logic, I see this
experimental option as a good way to move forward.
We have to use turn the iterator into a list because the graphlog is apparently
not ready for pure iterator input yet.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Fri, 14 Nov 2014 17:37:59 +0000 |
parents | f7ce0837eefd |
children | fee7a30cfdf5 |
line wrap: on
line diff
--- a/mercurial/graphmod.py Thu Sep 04 18:19:32 2014 +0200 +++ b/mercurial/graphmod.py Fri Nov 14 17:37:59 2014 +0000 @@ -199,6 +199,9 @@ lowestrev = revs.min() gpcache = {} + if repo.ui.configbool('experimental', 'graph-topological', False): + revs = list(groupbranchiter(revs, repo.changelog.parentrevs)) + for rev in revs: ctx = repo[rev] parents = sorted(set([p.rev() for p in ctx.parents()