# HG changeset patch # User Gregory Szorc # Date 2015-03-28 19:58:44 # Node ID 944749de6f3a4401c14914686156d7c4aff4e32b # Parent ecac0dd246a853d25d37772264d2b5f807e42295 commands.debugrevlog: report max chain length This is sometimes useful to know. Report it. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2843,6 +2843,7 @@ def debugrevlog(ui, repo, file_=None, ** deltasize[2] /= numrevs - numfull totalsize = fulltotal + deltatotal avgchainlen = sum(chainlengths) / numrevs + maxchainlen = max(chainlengths) compratio = totalrawsize / totalsize basedfmtstr = '%%%dd\n' @@ -2875,6 +2876,7 @@ def debugrevlog(ui, repo, file_=None, ** 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: diff --git a/tests/test-debugcommands.t b/tests/test-debugcommands.t --- a/tests/test-debugcommands.t +++ b/tests/test-debugcommands.t @@ -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