Mercurial > hg
comparison tests/test-glog-topological.t @ 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 | d7af9b4ae7dd |
children | 46825334f270 |
comparison
equal
deleted
inserted
replaced
29347:98535ad46fc0 | 29348:2188f170f5b6 |
---|---|
38 o 0 | 38 o 0 |
39 | 39 |
40 | 40 |
41 (display all nodes) | 41 (display all nodes) |
42 | 42 |
43 $ hg --config experimental.graph-group-branches=1 log -G | 43 $ hg log -G -r 'sort(all(), topo)' |
44 o 8 | 44 o 8 |
45 | | 45 | |
46 o 3 | 46 o 3 |
47 | | 47 | |
48 o 2 | 48 o 2 |
60 o 0 | 60 o 0 |
61 | 61 |
62 | 62 |
63 (revset skipping nodes) | 63 (revset skipping nodes) |
64 | 64 |
65 $ hg --config experimental.graph-group-branches=1 log -G --rev 'not (2+6)' | 65 $ hg log -G --rev 'sort(not (2+6), topo)' |
66 o 8 | 66 o 8 |
67 | | 67 | |
68 o 3 | 68 o 3 |
69 : | 69 : |
70 o 1 | 70 o 1 |
78 o 0 | 78 o 0 |
79 | 79 |
80 | 80 |
81 (begin) from the other branch | 81 (begin) from the other branch |
82 | 82 |
83 $ hg --config experimental.graph-group-branches=1 --config experimental.graph-group-branches.firstbranch=5 log -G | 83 $ hg log -G -r 'sort(all(), topo, topo.firstbranch=5)' |
84 o 7 | 84 o 7 |
85 | | 85 | |
86 o 6 | 86 o 6 |
87 | | 87 | |
88 o 5 | 88 o 5 |