changeset 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 ecac0dd246a8
children 7046ecabd9a8
files mercurial/commands.py tests/test-debugcommands.t
diffstat 2 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Mar 27 20:55:54 2015 -0700
+++ b/mercurial/commands.py	Sat Mar 28 12:58:44 2015 -0700
@@ -2843,6 +2843,7 @@
         deltasize[2] /= numrevs - numfull
     totalsize = fulltotal + deltatotal
     avgchainlen = sum(chainlengths) / numrevs
+    maxchainlen = max(chainlengths)
     compratio = totalrawsize / totalsize
 
     basedfmtstr = '%%%dd\n'
@@ -2875,6 +2876,7 @@
     ui.write('\n')
     fmt = dfmtstr(max(avgchainlen, compratio))
     ui.write(('avg chain length  : ') + fmt % avgchainlen)
+    ui.write(('max chain length  : ') + fmt % maxchainlen)
     ui.write(('compression ratio : ') + fmt % compratio)
 
     if format > 0:
--- a/tests/test-debugcommands.t	Fri Mar 27 20:55:54 2015 -0700
+++ b/tests/test-debugcommands.t	Sat Mar 28 12:58:44 2015 -0700
@@ -18,6 +18,7 @@
       deltas    :  0 ( 0.00%)
   
   avg chain length  : 0
+  max chain length  : 0
   compression ratio : 0
   
   uncompressed data size (min/max/avg) : 43 / 43 / 43