diff --git a/mercurial/graphmod.py b/mercurial/graphmod.py --- a/mercurial/graphmod.py +++ b/mercurial/graphmod.py @@ -199,6 +199,9 @@ def dagwalker(repo, revs): 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() diff --git a/tests/test-glog-topological.t b/tests/test-glog-topological.t new file mode 100644 --- /dev/null +++ b/tests/test-glog-topological.t @@ -0,0 +1,58 @@ +This test file aims at test topological iteration and the various configuration it can has. + + $ cat >> $HGRCPATH << EOF + > [ui] + > logtemplate={rev}\n + > EOF + +On this simple example, all topological branch are displayed in turn until we +can finally display 0. this implies skipping from 8 to 3 and coming back to 7 +later. + + $ hg init test01 + $ cd test01 + $ hg unbundle $TESTDIR/bundles/remote.hg + adding changesets + adding manifests + adding file changes + added 9 changesets with 7 changes to 4 files (+1 heads) + (run 'hg heads' to see heads, 'hg merge' to merge) + + $ hg log -G + o 8 + | + | o 7 + | | + | o 6 + | | + | o 5 + | | + | o 4 + | | + o | 3 + | | + o | 2 + | | + o | 1 + |/ + o 0 + + $ hg --config experimental.graph-topological=1 log -G + o 8 + | + o 3 + | + o 2 + | + o 1 + | + | o 7 + | | + | o 6 + | | + | o 5 + | | + | o 4 + |/ + o 0 +