Debian Codegraph @

tests/test-fastannotate-perfhack.t

raw
1 $ cat >> $HGRCPATH << EOF
2 > [extensions]
3 > fastannotate=
4 > [fastannotate]
5 > perfhack=1
6 > EOF
7
8 $ hg init repo
9 $ cd repo
10
11 a simple merge case
12
13 $ echo 1 > a
14 $ hg commit -qAm 'append 1'
15 $ echo 2 >> a
16 $ hg commit -m 'append 2'
17 $ echo 3 >> a
18 $ hg commit -m 'append 3'
19 $ hg up 1 -q
20 $ cat > a << EOF
21 > 0
22 > 1
23 > 2
24 > EOF
25 $ hg commit -qm 'insert 0'
26 $ hg merge 2 -q
27 $ echo 4 >> a
28 $ hg commit -m merge
29 $ hg log -G -T '{rev}: {desc}'
30 @ 4: merge
31 |\
32 | o 3: insert 0
33 | |
34 o | 2: append 3
35 |/
36 o 1: append 2
37 |
38 o 0: append 1
39
40 $ hg fastannotate a
41 3: 0
42 0: 1
43 1: 2
44 2: 3
45 4: 4
46 $ hg fastannotate -r 0 a
47 0: 1
48 $ hg fastannotate -r 1 a
49 0: 1
50 1: 2
51 $ hg fastannotate -udnclf a
52 test 3 d641cb51f61e Thu Jan 01 00:00:00 1970 +0000 a:1: 0
53 test 0 4994017376d3 Thu Jan 01 00:00:00 1970 +0000 a:1: 1
54 test 1 e940cb6d9a06 Thu Jan 01 00:00:00 1970 +0000 a:2: 2
55 test 2 26162a884ba6 Thu Jan 01 00:00:00 1970 +0000 a:3: 3
56 test 4 3ad7bcd2815f Thu Jan 01 00:00:00 1970 +0000 a:5: 4
57 $ hg fastannotate --linear a
58 3: 0
59 0: 1
60 1: 2
61 4: 3
62 4: 4
63
64 incrementally updating
65
66 $ hg fastannotate -r 0 a --debug
67 fastannotate: a: using fast path (resolved fctx: True)
68 0: 1
69 $ hg fastannotate -r 0 a --debug --rebuild
70 fastannotate: a: 1 new changesets in the main branch
71 0: 1
72 $ hg fastannotate -r 1 a --debug
73 fastannotate: a: 1 new changesets in the main branch
74 0: 1
75 1: 2
76 $ hg fastannotate -r 3 a --debug
77 fastannotate: a: 1 new changesets in the main branch
78 3: 0
79 0: 1
80 1: 2
81 $ hg fastannotate -r 4 a --debug
82 fastannotate: a: 1 new changesets in the main branch
83 3: 0
84 0: 1
85 1: 2
86 2: 3
87 4: 4
88 $ hg fastannotate -r 1 a --debug
89 fastannotate: a: using fast path (resolved fctx: True)
90 0: 1
91 1: 2
92
93 rebuild happens automatically if unable to update
94
95 $ hg fastannotate -r 2 a --debug
96 fastannotate: a: cache broken and deleted
97 fastannotate: a: 3 new changesets in the main branch
98 0: 1
99 1: 2
100 2: 3
101
102 config option "fastannotate.mainbranch"
103
104 $ hg fastannotate -r 1 --rebuild --config fastannotate.mainbranch=tip a --debug
105 fastannotate: a: 4 new changesets in the main branch
106 0: 1
107 1: 2
108 $ hg fastannotate -r 4 a --debug
109 fastannotate: a: using fast path (resolved fctx: True)
110 3: 0
111 0: 1
112 1: 2
113 2: 3
114 4: 4
115
116 rename
117
118 $ hg mv a b
119 $ cat > b << EOF
120 > 0
121 > 11
122 > 3
123 > 44
124 > EOF
125 $ hg commit -m b -q
126 $ hg fastannotate -ncf --long-hash b
127 3 d641cb51f61e331c44654104301f8154d7865c89 a: 0
128 5 d44dade239915bc82b91e4556b1257323f8e5824 b: 11
129 2 26162a884ba60e8c87bf4e0d6bb8efcc6f711a4e a: 3
130 5 d44dade239915bc82b91e4556b1257323f8e5824 b: 44
131 $ hg fastannotate -r 26162a884ba60e8c87bf4e0d6bb8efcc6f711a4e a
132 0: 1
133 1: 2
134 2: 3
135
136 fastannotate --deleted
137
138 $ hg fastannotate --deleted -nf b
139 3 a: 0
140 5 b: 11
141 0 a: -1
142 1 a: -2
143 2 a: 3
144 5 b: 44
145 4 a: -4
146 $ hg fastannotate --deleted -r 3 -nf a
147 3 a: 0
148 0 a: 1
149 1 a: 2
150
151 file and directories with ".l", ".m" suffixes
152
153 $ cd ..
154 $ hg init repo2
155 $ cd repo2
156
157 $ mkdir a.l b.m c.lock a.l.hg b.hg
158 $ for i in a b c d d.l d.m a.l/a b.m/a c.lock/a a.l.hg/a b.hg/a; do
159 > echo $i > $i
160 > done
161 $ hg add . -q
162 $ hg commit -m init
163 $ hg fastannotate a.l/a b.m/a c.lock/a a.l.hg/a b.hg/a d.l d.m a b c d
164 0: a
165 0: a.l.hg/a
166 0: a.l/a
167 0: b
168 0: b.hg/a
169 0: b.m/a
170 0: c
171 0: c.lock/a
172 0: d
173 0: d.l
174 0: d.m
175
176 empty file
177
178 $ touch empty
179 $ hg commit -A empty -m empty
180 $ hg fastannotate empty