##// 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 if largestblock < blksize:
715 if largestblock < blksize:
716 largestblock = blksize
716 largestblock = blksize
717
717
718 readdensity = float(chainsize) / float(readsize)
718 if readsize:
719 readdensity = float(chainsize) / float(readsize)
720 else:
721 readdensity = 1
719
722
720 fm.write('readsize largestblock readdensity srchunks',
723 fm.write('readsize largestblock readdensity srchunks',
721 ' %10d %10d %9.5f %8d',
724 ' %10d %10d %9.5f %8d',
@@ -8,33 +8,41 b''
8 $ echo a > a
8 $ echo a > a
9 $ hg ci -Am adda
9 $ hg ci -Am adda
10 adding a
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 #if reporevlogstore
17 #if reporevlogstore
12 $ hg debugrevlog -m
18 $ hg debugrevlog -m
13 format : 1
19 format : 1
14 flags : inline, generaldelta
20 flags : inline, generaldelta
15
21
16 revisions : 1
22 revisions : 3
17 merges : 0 ( 0.00%)
23 merges : 0 ( 0.00%)
18 normal : 1 (100.00%)
24 normal : 3 (100.00%)
19 revisions : 1
25 revisions : 3
20 full : 1 (100.00%)
26 full : 3 (100.00%)
21 deltas : 0 ( 0.00%)
27 deltas : 0 ( 0.00%)
22 revision size : 44
28 revision size : 88
23 full : 44 (100.00%)
29 full : 88 (100.00%)
24 deltas : 0 ( 0.00%)
30 deltas : 0 ( 0.00%)
25
31
26 chunks : 1
32 chunks : 3
27 0x75 (u) : 1 (100.00%)
33 empty : 1 (33.33%)
28 chunks size : 44
34 0x75 (u) : 2 (66.67%)
29 0x75 (u) : 44 (100.00%)
35 chunks size : 88
36 empty : 0 ( 0.00%)
37 0x75 (u) : 88 (100.00%)
30
38
31 avg chain length : 0
39 avg chain length : 0
32 max chain length : 0
40 max chain length : 0
33 max chain reach : 44
41 max chain reach : 44
34 compression ratio : 0
42 compression ratio : 0
35
43
36 uncompressed data size (min/max/avg) : 43 / 43 / 43
44 uncompressed data size (min/max/avg) : 0 / 43 / 28
37 full revision size (min/max/avg) : 44 / 44 / 44
45 full revision size (min/max/avg) : 0 / 44 / 29
38 delta size (min/max/avg) : 0 / 0 / 0
46 delta size (min/max/avg) : 0 / 0 / 0
39 #endif
47 #endif
40
48
@@ -73,9 +81,13 b' debugdelta chain basic output'
73 $ hg debugdeltachain -m
81 $ hg debugdeltachain -m
74 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
82 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio
75 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000
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 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen}\n'
87 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen}\n'
78 0 1 1
88 0 1 1
89 1 2 1
90 2 3 1
79
91
80 $ hg debugdeltachain -m -Tjson
92 $ hg debugdeltachain -m -Tjson
81 [
93 [
@@ -92,6 +104,34 b' debugdelta chain basic output'
92 "prevrev": -1,
104 "prevrev": -1,
93 "rev": 0,
105 "rev": 0,
94 "uncompsize": 43
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 $ hg debugdeltachain -m
144 $ hg debugdeltachain -m
105 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
145 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
106 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
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 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen} {readsize} {largestblock} {readdensity}\n'
150 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen} {readsize} {largestblock} {readdensity}\n'
109 0 1 1 44 44 1.0
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 $ hg debugdeltachain -m -Tjson
155 $ hg debugdeltachain -m -Tjson
112 [
156 [
@@ -127,6 +171,42 b' debugdelta chain with sparse read enable'
127 "rev": 0,
171 "rev": 0,
128 "srchunks": 1,
172 "srchunks": 1,
129 "uncompsize": 43
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