comparison mercurial/commands.py @ 24503:944749de6f3a

commands.debugrevlog: report max chain length This is sometimes useful to know. Report it.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 28 Mar 2015 12:58:44 -0700
parents 0142b59f5743
children 51930a7180bd
comparison
equal deleted inserted replaced
24502:ecac0dd246a8 24503:944749de6f3a
2841 deltatotal = deltasize[2] 2841 deltatotal = deltasize[2]
2842 if numrevs - numfull > 0: 2842 if numrevs - numfull > 0:
2843 deltasize[2] /= numrevs - numfull 2843 deltasize[2] /= numrevs - numfull
2844 totalsize = fulltotal + deltatotal 2844 totalsize = fulltotal + deltatotal
2845 avgchainlen = sum(chainlengths) / numrevs 2845 avgchainlen = sum(chainlengths) / numrevs
2846 maxchainlen = max(chainlengths)
2846 compratio = totalrawsize / totalsize 2847 compratio = totalrawsize / totalsize
2847 2848
2848 basedfmtstr = '%%%dd\n' 2849 basedfmtstr = '%%%dd\n'
2849 basepcfmtstr = '%%%dd %s(%%5.2f%%%%)\n' 2850 basepcfmtstr = '%%%dd %s(%%5.2f%%%%)\n'
2850 2851
2873 ui.write((' deltas : ') + fmt % pcfmt(deltatotal, totalsize)) 2874 ui.write((' deltas : ') + fmt % pcfmt(deltatotal, totalsize))
2874 2875
2875 ui.write('\n') 2876 ui.write('\n')
2876 fmt = dfmtstr(max(avgchainlen, compratio)) 2877 fmt = dfmtstr(max(avgchainlen, compratio))
2877 ui.write(('avg chain length : ') + fmt % avgchainlen) 2878 ui.write(('avg chain length : ') + fmt % avgchainlen)
2879 ui.write(('max chain length : ') + fmt % maxchainlen)
2878 ui.write(('compression ratio : ') + fmt % compratio) 2880 ui.write(('compression ratio : ') + fmt % compratio)
2879 2881
2880 if format > 0: 2882 if format > 0:
2881 ui.write('\n') 2883 ui.write('\n')
2882 ui.write(('uncompressed data size (min/max/avg) : %d / %d / %d\n') 2884 ui.write(('uncompressed data size (min/max/avg) : %d / %d / %d\n')