Show More
@@ -2097,6 +2097,8 b' def debugrevlog(ui, repo, file_=None, **' | |||||
2097 | numfull = 0 |
|
2097 | numfull = 0 | |
2098 | # intermediate snapshot against a prior snapshot |
|
2098 | # intermediate snapshot against a prior snapshot | |
2099 | numsemi = 0 |
|
2099 | numsemi = 0 | |
|
2100 | # snapshot count per depth | |||
|
2101 | numsnapdepth = collections.defaultdict(lambda: 0) | |||
2100 | # delta against previous revision |
|
2102 | # delta against previous revision | |
2101 | numprev = 0 |
|
2103 | numprev = 0 | |
2102 | # delta against first or second parent (not prev) |
|
2104 | # delta against first or second parent (not prev) | |
@@ -2118,6 +2120,8 b' def debugrevlog(ui, repo, file_=None, **' | |||||
2118 | datasize = [None, 0, 0] |
|
2120 | datasize = [None, 0, 0] | |
2119 | fullsize = [None, 0, 0] |
|
2121 | fullsize = [None, 0, 0] | |
2120 | semisize = [None, 0, 0] |
|
2122 | semisize = [None, 0, 0] | |
|
2123 | # snapshot count per depth | |||
|
2124 | snapsizedepth = collections.defaultdict(lambda: [None, 0, 0]) | |||
2121 | deltasize = [None, 0, 0] |
|
2125 | deltasize = [None, 0, 0] | |
2122 | chunktypecounts = {} |
|
2126 | chunktypecounts = {} | |
2123 | chunktypesizes = {} |
|
2127 | chunktypesizes = {} | |
@@ -2147,7 +2151,9 b' def debugrevlog(ui, repo, file_=None, **' | |||||
2147 | numemptytext += 1 |
|
2151 | numemptytext += 1 | |
2148 | else: |
|
2152 | else: | |
2149 | numfull += 1 |
|
2153 | numfull += 1 | |
|
2154 | numsnapdepth[0] += 1 | |||
2150 | addsize(size, fullsize) |
|
2155 | addsize(size, fullsize) | |
|
2156 | addsize(size, snapsizedepth[0]) | |||
2151 | else: |
|
2157 | else: | |
2152 | chainlengths.append(chainlengths[delta] + 1) |
|
2158 | chainlengths.append(chainlengths[delta] + 1) | |
2153 | baseaddr = chainbases[delta] |
|
2159 | baseaddr = chainbases[delta] | |
@@ -2160,6 +2166,9 b' def debugrevlog(ui, repo, file_=None, **' | |||||
2160 | elif r.issnapshot(rev): |
|
2166 | elif r.issnapshot(rev): | |
2161 | addsize(size, semisize) |
|
2167 | addsize(size, semisize) | |
2162 | numsemi += 1 |
|
2168 | numsemi += 1 | |
|
2169 | depth = r.snapshotdepth(rev) | |||
|
2170 | numsnapdepth[depth] += 1 | |||
|
2171 | addsize(size, snapsizedepth[depth]) | |||
2163 | else: |
|
2172 | else: | |
2164 | addsize(size, deltasize) |
|
2173 | addsize(size, deltasize) | |
2165 | if delta == rev - 1: |
|
2174 | if delta == rev - 1: | |
@@ -2204,8 +2213,13 b' def debugrevlog(ui, repo, file_=None, **' | |||||
2204 | fulltotal = fullsize[2] |
|
2213 | fulltotal = fullsize[2] | |
2205 | fullsize[2] /= numfull |
|
2214 | fullsize[2] /= numfull | |
2206 | semitotal = semisize[2] |
|
2215 | semitotal = semisize[2] | |
|
2216 | snaptotal = {} | |||
2207 | if 0 < numsemi: |
|
2217 | if 0 < numsemi: | |
2208 | semisize[2] /= numsemi |
|
2218 | semisize[2] /= numsemi | |
|
2219 | for depth in snapsizedepth: | |||
|
2220 | snaptotal[depth] = snapsizedepth[depth][2] | |||
|
2221 | snapsizedepth[depth][2] /= numsnapdepth[depth] | |||
|
2222 | ||||
2209 | deltatotal = deltasize[2] |
|
2223 | deltatotal = deltasize[2] | |
2210 | if numdeltas > 0: |
|
2224 | if numdeltas > 0: | |
2211 | deltasize[2] /= numdeltas |
|
2225 | deltasize[2] /= numdeltas | |
@@ -2246,12 +2260,17 b' def debugrevlog(ui, repo, file_=None, **' | |||||
2246 | + fmt % pcfmt(numemptytext, numemptytext + numemptydelta)) |
|
2260 | + fmt % pcfmt(numemptytext, numemptytext + numemptydelta)) | |
2247 | ui.write((' delta : ') |
|
2261 | ui.write((' delta : ') | |
2248 | + fmt % pcfmt(numemptydelta, numemptytext + numemptydelta)) |
|
2262 | + fmt % pcfmt(numemptydelta, numemptytext + numemptydelta)) | |
2249 |
ui.write((' |
|
2263 | ui.write((' snapshot : ') + fmt % pcfmt(numfull + numsemi, numrevs)) | |
2250 | ui.write((' inter : ') + fmt % pcfmt(numsemi, numrevs)) |
|
2264 | for depth in sorted(numsnapdepth): | |
|
2265 | ui.write((' lvl-%-3d : ' % depth) | |||
|
2266 | + fmt % pcfmt(numsnapdepth[depth], numrevs)) | |||
2251 | ui.write((' deltas : ') + fmt % pcfmt(numdeltas, numrevs)) |
|
2267 | ui.write((' deltas : ') + fmt % pcfmt(numdeltas, numrevs)) | |
2252 | ui.write(('revision size : ') + fmt2 % totalsize) |
|
2268 | ui.write(('revision size : ') + fmt2 % totalsize) | |
2253 | ui.write((' full : ') + fmt % pcfmt(fulltotal, totalsize)) |
|
2269 | ui.write((' snapshot : ') | |
2254 |
|
|
2270 | + fmt % pcfmt(fulltotal + semitotal, totalsize)) | |
|
2271 | for depth in sorted(numsnapdepth): | |||
|
2272 | ui.write((' lvl-%-3d : ' % depth) | |||
|
2273 | + fmt % pcfmt(snaptotal[depth], totalsize)) | |||
2255 | ui.write((' deltas : ') + fmt % pcfmt(deltatotal, totalsize)) |
|
2274 | ui.write((' deltas : ') + fmt % pcfmt(deltatotal, totalsize)) | |
2256 |
|
2275 | |||
2257 | def fmtchunktype(chunktype): |
|
2276 | def fmtchunktype(chunktype): | |
@@ -2285,6 +2304,13 b' def debugrevlog(ui, repo, file_=None, **' | |||||
2285 | % tuple(datasize)) |
|
2304 | % tuple(datasize)) | |
2286 | ui.write(('full revision size (min/max/avg) : %d / %d / %d\n') |
|
2305 | ui.write(('full revision size (min/max/avg) : %d / %d / %d\n') | |
2287 | % tuple(fullsize)) |
|
2306 | % tuple(fullsize)) | |
|
2307 | ui.write(('inter-snapshot size (min/max/avg) : %d / %d / %d\n') | |||
|
2308 | % tuple(semisize)) | |||
|
2309 | for depth in sorted(snapsizedepth): | |||
|
2310 | if depth == 0: | |||
|
2311 | continue | |||
|
2312 | ui.write((' level-%-3d (min/max/avg) : %d / %d / %d\n') | |||
|
2313 | % ((depth,) + tuple(snapsizedepth[depth]))) | |||
2288 | ui.write(('delta size (min/max/avg) : %d / %d / %d\n') |
|
2314 | ui.write(('delta size (min/max/avg) : %d / %d / %d\n') | |
2289 | % tuple(deltasize)) |
|
2315 | % tuple(deltasize)) | |
2290 |
|
2316 |
@@ -26,12 +26,12 b'' | |||||
26 | empty : 0 ( 0.00%) |
|
26 | empty : 0 ( 0.00%) | |
27 | text : 0 (100.00%) |
|
27 | text : 0 (100.00%) | |
28 | delta : 0 (100.00%) |
|
28 | delta : 0 (100.00%) | |
29 |
|
|
29 | snapshot : 3 (100.00%) | |
30 |
|
|
30 | lvl-0 : 3 (100.00%) | |
31 | deltas : 0 ( 0.00%) |
|
31 | deltas : 0 ( 0.00%) | |
32 | revision size : 191 |
|
32 | revision size : 191 | |
33 |
|
|
33 | snapshot : 191 (100.00%) | |
34 |
|
|
34 | lvl-0 : 191 (100.00%) | |
35 | deltas : 0 ( 0.00%) |
|
35 | deltas : 0 ( 0.00%) | |
36 |
|
36 | |||
37 | chunks : 3 |
|
37 | chunks : 3 | |
@@ -46,6 +46,7 b'' | |||||
46 |
|
46 | |||
47 | uncompressed data size (min/max/avg) : 57 / 66 / 62 |
|
47 | uncompressed data size (min/max/avg) : 57 / 66 / 62 | |
48 | full revision size (min/max/avg) : 58 / 67 / 63 |
|
48 | full revision size (min/max/avg) : 58 / 67 / 63 | |
|
49 | inter-snapshot size (min/max/avg) : 0 / 0 / 0 | |||
49 | delta size (min/max/avg) : 0 / 0 / 0 |
|
50 | delta size (min/max/avg) : 0 / 0 / 0 | |
50 | $ hg debugrevlog -m |
|
51 | $ hg debugrevlog -m | |
51 | format : 1 |
|
52 | format : 1 | |
@@ -58,12 +59,12 b'' | |||||
58 | empty : 1 (33.33%) |
|
59 | empty : 1 (33.33%) | |
59 | text : 1 (100.00%) |
|
60 | text : 1 (100.00%) | |
60 | delta : 0 ( 0.00%) |
|
61 | delta : 0 ( 0.00%) | |
61 |
|
|
62 | snapshot : 2 (66.67%) | |
62 | inter : 0 ( 0.00%) |
|
63 | lvl-0 : 2 (66.67%) | |
63 | deltas : 0 ( 0.00%) |
|
64 | deltas : 0 ( 0.00%) | |
64 | revision size : 88 |
|
65 | revision size : 88 | |
65 |
|
|
66 | snapshot : 88 (100.00%) | |
66 |
|
|
67 | lvl-0 : 88 (100.00%) | |
67 | deltas : 0 ( 0.00%) |
|
68 | deltas : 0 ( 0.00%) | |
68 |
|
69 | |||
69 | chunks : 3 |
|
70 | chunks : 3 | |
@@ -80,6 +81,7 b'' | |||||
80 |
|
81 | |||
81 | uncompressed data size (min/max/avg) : 0 / 43 / 28 |
|
82 | uncompressed data size (min/max/avg) : 0 / 43 / 28 | |
82 | full revision size (min/max/avg) : 44 / 44 / 44 |
|
83 | full revision size (min/max/avg) : 44 / 44 / 44 | |
|
84 | inter-snapshot size (min/max/avg) : 0 / 0 / 0 | |||
83 | delta size (min/max/avg) : 0 / 0 / 0 |
|
85 | delta size (min/max/avg) : 0 / 0 / 0 | |
84 | $ hg debugrevlog a |
|
86 | $ hg debugrevlog a | |
85 | format : 1 |
|
87 | format : 1 | |
@@ -92,12 +94,12 b'' | |||||
92 | empty : 0 ( 0.00%) |
|
94 | empty : 0 ( 0.00%) | |
93 | text : 0 (100.00%) |
|
95 | text : 0 (100.00%) | |
94 | delta : 0 (100.00%) |
|
96 | delta : 0 (100.00%) | |
95 |
|
|
97 | snapshot : 1 (100.00%) | |
96 |
|
|
98 | lvl-0 : 1 (100.00%) | |
97 | deltas : 0 ( 0.00%) |
|
99 | deltas : 0 ( 0.00%) | |
98 | revision size : 3 |
|
100 | revision size : 3 | |
99 |
|
|
101 | snapshot : 3 (100.00%) | |
100 |
|
|
102 | lvl-0 : 3 (100.00%) | |
101 | deltas : 0 ( 0.00%) |
|
103 | deltas : 0 ( 0.00%) | |
102 |
|
104 | |||
103 | chunks : 1 |
|
105 | chunks : 1 | |
@@ -112,6 +114,7 b'' | |||||
112 |
|
114 | |||
113 | uncompressed data size (min/max/avg) : 2 / 2 / 2 |
|
115 | uncompressed data size (min/max/avg) : 2 / 2 / 2 | |
114 | full revision size (min/max/avg) : 3 / 3 / 3 |
|
116 | full revision size (min/max/avg) : 3 / 3 / 3 | |
|
117 | inter-snapshot size (min/max/avg) : 0 / 0 / 0 | |||
115 | delta size (min/max/avg) : 0 / 0 / 0 |
|
118 | delta size (min/max/avg) : 0 / 0 / 0 | |
116 | #endif |
|
119 | #endif | |
117 |
|
120 |
General Comments 0
You need to be logged in to leave comments.
Login now