Mercurial > public > mercurial-scm > hg-stable
comparison 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 |
comparison
equal
deleted
inserted
replaced
23564:f7ce0837eefd | 23565:996c01bfbec4 |
---|---|
197 | 197 |
198 cl = repo.changelog | 198 cl = repo.changelog |
199 lowestrev = revs.min() | 199 lowestrev = revs.min() |
200 gpcache = {} | 200 gpcache = {} |
201 | 201 |
202 if repo.ui.configbool('experimental', 'graph-topological', False): | |
203 revs = list(groupbranchiter(revs, repo.changelog.parentrevs)) | |
204 | |
202 for rev in revs: | 205 for rev in revs: |
203 ctx = repo[rev] | 206 ctx = repo[rev] |
204 parents = sorted(set([p.rev() for p in ctx.parents() | 207 parents = sorted(set([p.rev() for p in ctx.parents() |
205 if p.rev() in revs])) | 208 if p.rev() in revs])) |
206 mpars = [p.rev() for p in ctx.parents() if | 209 mpars = [p.rev() for p in ctx.parents() if |