##// END OF EJS Templates
debugdeltachain: protect against 0 readsize...
Boris Feld -
r38669:0f4c2c70 default
parent child Browse files
Show More
@@ -715,7 +715,10 b' def debugdeltachain(ui, repo, file_=None'
715 715 if largestblock < blksize:
716 716 largestblock = blksize
717 717
718 if readsize:
718 719 readdensity = float(chainsize) / float(readsize)
720 else:
721 readdensity = 1
719 722
720 723 fm.write('readsize largestblock readdensity srchunks',
721 724 ' %10d %10d %9.5f %8d',
@@ -8,33 +8,41 b''
8 8 $ echo a > a
9 9 $ hg ci -Am adda
10 10 adding a
11 $ hg rm .
12 removing a
13 $ hg ci -Am make-it-empty
14 $ hg revert --all -r 0
15 adding a
16 $ hg ci -Am make-it-full
11 17 #if reporevlogstore
12 18 $ hg debugrevlog -m
13 19 format : 1
14 20 flags : inline, generaldelta
15 21
16 revisions : 1
22 revisions : 3
17 23 merges : 0 ( 0.00%)
18 normal : 1 (100.00%)
19 revisions : 1
20 full : 1 (100.00%)
24 normal : 3 (100.00%)
25 revisions : 3
26 full : 3 (100.00%)
21 27 deltas : 0 ( 0.00%)
22 revision size : 44
23 full : 44 (100.00%)
28 revision size : 88
29 full : 88 (100.00%)
24 30 deltas : 0 ( 0.00%)
25 31
26 chunks : 1
27 0x75 (u) : 1 (100.00%)
28 chunks size : 44
29 0x75 (u) : 44 (100.00%)
32 chunks : 3
33 empty : 1 (33.33%)
34 0x75 (u) : 2 (66.67%)
35 chunks size : 88
36 empty : 0 ( 0.00%)
37 0x75 (u) : 88 (100.00%)
30 38
31 39 avg chain length : 0
32 40 max chain length : 0
33 41 max chain reach : 44
34 42 compression ratio : 0
35 43
36 uncompressed data size (min/max/avg) : 43 / 43 / 43
37 full revision size (min/max/avg) : 44 / 44 / 44
44 uncompressed data size (min/max/avg) : 0 / 43 / 28
45 full revision size (min/max/avg) : 0 / 44 / 29
38 46 delta size (min/max/avg) : 0 / 0 / 0
39 47 #endif
40 48
@@ -73,9 +81,13 b' debugdelta chain basic output'
73 81 $ hg debugdeltachain -m
74 82 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
75 83 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000
84 1 2 1 -1 base 0 0 0 0.00000 0 0 0.00000
85 2 3 1 -1 base 44 43 44 1.02326 44 0 0.00000
76 86
77 87 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen}\n'
78 88 0 1 1
89 1 2 1
90 2 3 1
79 91
80 92 $ hg debugdeltachain -m -Tjson
81 93 [
@@ -92,6 +104,34 b' debugdelta chain basic output'
92 104 "prevrev": -1,
93 105 "rev": 0,
94 106 "uncompsize": 43
107 },
108 {
109 "chainid": 2,
110 "chainlen": 1,
111 "chainratio": 0,
112 "chainsize": 0,
113 "compsize": 0,
114 "deltatype": "base",
115 "extradist": 0,
116 "extraratio": 0,
117 "lindist": 0,
118 "prevrev": -1,
119 "rev": 1,
120 "uncompsize": 0
121 },
122 {
123 "chainid": 3,
124 "chainlen": 1,
125 "chainratio": 1.02325581395,
126 "chainsize": 44,
127 "compsize": 44,
128 "deltatype": "base",
129 "extradist": 0,
130 "extraratio": 0.0,
131 "lindist": 44,
132 "prevrev": -1,
133 "rev": 2,
134 "uncompsize": 43
95 135 }
96 136 ]
97 137
@@ -104,9 +144,13 b' debugdelta chain with sparse read enable'
104 144 $ hg debugdeltachain -m
105 145 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
106 146 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
147 1 2 1 -1 base 0 0 0 0.00000 0 0 0.00000 0 0 1.00000 1
148 2 3 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
107 149
108 150 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen} {readsize} {largestblock} {readdensity}\n'
109 151 0 1 1 44 44 1.0
152 1 2 1 0 0 1
153 2 3 1 44 44 1.0
110 154
111 155 $ hg debugdeltachain -m -Tjson
112 156 [
@@ -127,6 +171,42 b' debugdelta chain with sparse read enable'
127 171 "rev": 0,
128 172 "srchunks": 1,
129 173 "uncompsize": 43
174 },
175 {
176 "chainid": 2,
177 "chainlen": 1,
178 "chainratio": 0,
179 "chainsize": 0,
180 "compsize": 0,
181 "deltatype": "base",
182 "extradist": 0,
183 "extraratio": 0,
184 "largestblock": 0,
185 "lindist": 0,
186 "prevrev": -1,
187 "readdensity": 1,
188 "readsize": 0,
189 "rev": 1,
190 "srchunks": 1,
191 "uncompsize": 0
192 },
193 {
194 "chainid": 3,
195 "chainlen": 1,
196 "chainratio": 1.02325581395,
197 "chainsize": 44,
198 "compsize": 44,
199 "deltatype": "base",
200 "extradist": 0,
201 "extraratio": 0.0,
202 "largestblock": 44,
203 "lindist": 44,
204 "prevrev": -1,
205 "readdensity": 1.0,
206 "readsize": 44,
207 "rev": 2,
208 "srchunks": 1,
209 "uncompsize": 43
130 210 }
131 211 ]
132 212
General Comments 0
You need to be logged in to leave comments. Login now