test-glog-topological.t
154 lines
| 1.7 KiB
| text/troff
|
Tads3Lexer
/ tests / test-glog-topological.t
Pierre-Yves David
|
r23565 | 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) | ||||
Boris Feld
|
r39516 | new changesets bfaf4b5cbf01:916f1afdef90 (9 drafts) | ||
Pierre-Yves David
|
r23565 | (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 | ||||
Pierre-Yves David
|
r23567 | |||
(display all nodes) | ||||
Martijn Pieters
|
r29348 | $ hg log -G -r 'sort(all(), topo)' | ||
Pierre-Yves David
|
r23565 | o 8 | ||
| | ||||
o 3 | ||||
| | ||||
o 2 | ||||
| | ||||
o 1 | ||||
| | ||||
| o 7 | ||||
| | | ||||
| o 6 | ||||
| | | ||||
| o 5 | ||||
| | | ||||
| o 4 | ||||
|/ | ||||
o 0 | ||||
Pierre-Yves David
|
r23567 | |||
Yuya Nishihara
|
r30003 | (display nodes filtered by log options) | ||
$ hg log -G -r 'sort(all(), topo)' -k '.3' | ||||
o 8 | ||||
| | ||||
o 3 | ||||
| | ||||
~ | ||||
o 7 | ||||
| | ||||
o 6 | ||||
| | ||||
~ | ||||
Pierre-Yves David
|
r23567 | (revset skipping nodes) | ||
Martijn Pieters
|
r29348 | $ hg log -G --rev 'sort(not (2+6), topo)' | ||
Pierre-Yves David
|
r23567 | o 8 | ||
| | ||||
o 3 | ||||
Martijn Pieters
|
r28627 | : | ||
Pierre-Yves David
|
r23567 | o 1 | ||
| | ||||
| o 7 | ||||
Martijn Pieters
|
r28627 | | : | ||
Pierre-Yves David
|
r23567 | | o 5 | ||
| | | ||||
| o 4 | ||||
|/ | ||||
o 0 | ||||
Pierre-Yves David
|
r23568 | (begin) from the other branch | ||
Martijn Pieters
|
r29348 | $ hg log -G -r 'sort(all(), topo, topo.firstbranch=5)' | ||
Pierre-Yves David
|
r23568 | o 7 | ||
| | ||||
o 6 | ||||
| | ||||
o 5 | ||||
| | ||||
o 4 | ||||
| | ||||
| o 8 | ||||
| | | ||||
| o 3 | ||||
| | | ||||
| o 2 | ||||
| | | ||||
| o 1 | ||||
|/ | ||||
o 0 | ||||
Martin von Zweigbergk
|
r42500 | |||
Topological sort can be turned on via config | ||||
$ cat >> $HGRCPATH << EOF | ||||
> [experimental] | ||||
> log.topo=true | ||||
> EOF | ||||
$ hg log -G | ||||
o 8 | ||||
| | ||||
o 3 | ||||
| | ||||
o 2 | ||||
| | ||||
o 1 | ||||
| | ||||
| o 7 | ||||
| | | ||||
| o 6 | ||||
| | | ||||
| o 5 | ||||
| | | ||||
| o 4 | ||||
|/ | ||||
o 0 | ||||
Does not affect non-graph log | ||||
$ hg log -T '{rev}\n' | ||||
8 | ||||
7 | ||||
6 | ||||
5 | ||||
4 | ||||
3 | ||||
2 | ||||
1 | ||||
0 | ||||