Debian Codegraph @

tests/test-glog-topological.t

raw
1 This test file aims at test topological iteration and the various configuration it can has.
2
3 $ cat >> $HGRCPATH << EOF
4 > [command-templates]
5 > log={rev}\n
6 > EOF
7
8 On this simple example, all topological branch are displayed in turn until we
9 can finally display 0. this implies skipping from 8 to 3 and coming back to 7
10 later.
11
12 $ hg init test01
13 $ cd test01
14 $ hg unbundle $TESTDIR/bundles/remote.hg
15 adding changesets
16 adding manifests
17 adding file changes
18 added 9 changesets with 7 changes to 4 files (+1 heads)
19 new changesets bfaf4b5cbf01:916f1afdef90 (9 drafts)
20 (run 'hg heads' to see heads, 'hg merge' to merge)
21
22 $ hg log -G
23 o 8
24 |
25 | o 7
26 | |
27 | o 6
28 | |
29 | o 5
30 | |
31 | o 4
32 | |
33 o | 3
34 | |
35 o | 2
36 | |
37 o | 1
38 |/
39 o 0
40
41
42 (display all nodes)
43
44 $ hg log -G -r 'sort(all(), topo)'
45 o 8
46 |
47 o 3
48 |
49 o 2
50 |
51 o 1
52 |
53 | o 7
54 | |
55 | o 6
56 | |
57 | o 5
58 | |
59 | o 4
60 |/
61 o 0
62
63
64 (display nodes filtered by log options)
65
66 $ hg log -G -r 'sort(all(), topo)' -k '.3'
67 o 8
68 |
69 o 3
70 |
71 ~
72 o 7
73 |
74 o 6
75 |
76 ~
77
78 (revset skipping nodes)
79
80 $ hg log -G --rev 'sort(not (2+6), topo)'
81 o 8
82 |
83 o 3
84 :
85 o 1
86 |
87 | o 7
88 | :
89 | o 5
90 | |
91 | o 4
92 |/
93 o 0
94
95
96 (begin) from the other branch
97
98 $ hg log -G -r 'sort(all(), topo, topo.firstbranch=5)'
99 o 7
100 |
101 o 6
102 |
103 o 5
104 |
105 o 4
106 |
107 | o 8
108 | |
109 | o 3
110 | |
111 | o 2
112 | |
113 | o 1
114 |/
115 o 0
116
117
118 Topological sort can be turned on via config
119
120 $ cat >> $HGRCPATH << EOF
121 > [experimental]
122 > log.topo=true
123 > EOF
124
125 $ hg log -G
126 o 8
127 |
128 o 3
129 |
130 o 2
131 |
132 o 1
133 |
134 | o 7
135 | |
136 | o 6
137 | |
138 | o 5
139 | |
140 | o 4
141 |/
142 o 0
143
144 Does not affect non-graph log
145 $ hg log -T '{rev}\n'
146 8
147 7
148 6
149 5
150 4
151 3
152 2
153 1
154 0