Mercurial > public > mercurial-scm > hg
diff mercurial/graphmod.py @ 29348:2188f170f5b6
revset: add new topographical sort
Sort revisions in reverse revision order but grouped by topographical branches.
Visualised as a graph, instead of:
o 4
|
| o 3
| |
| o 2
| |
o | 1
|/
o 0
revisions on a 'main' branch are emitted before 'side' branches:
o 4
|
o 1
|
| o 3
| |
| o 2
|/
o 0
where what constitutes a 'main' branch is configurable, so the sort could also
result in:
o 3
|
o 2
|
| o 4
| |
| o 1
|/
o 0
This sort was already available as an experimental option in the graphmod
module, from which it is now removed.
This sort is best used with hg log -G:
$ hg log -G "sort(all(), topo)"
author | Martijn Pieters <mjpieters@fb.com> |
---|---|
date | Mon, 13 Jun 2016 18:20:00 +0100 |
parents | 98535ad46fc0 |
children | aea06029919e |
line wrap: on
line diff
--- a/mercurial/graphmod.py Mon Jun 13 18:20:00 2016 +0100 +++ b/mercurial/graphmod.py Mon Jun 13 18:20:00 2016 +0100 @@ -52,16 +52,6 @@ gpcache = {} - if repo.ui.configbool('experimental', 'graph-group-branches', False): - firstbranch = () - firstbranchrevset = repo.ui.config( - 'experimental', 'graph-group-branches.firstbranch', '') - if firstbranchrevset: - firstbranch = repo.revs(firstbranchrevset) - parentrevs = repo.changelog.parentrevs - revs = revset.groupbranchiter(revs, parentrevs, firstbranch) - revs = revset.baseset(revs) - for rev in revs: ctx = repo[rev] # partition into parents in the rev set and missing parents, then