changeset 39082:a456c603a83d

debugrevlog: display details about empty revision We now display details about the course of emptiness (empty text or empty delta).
author Boris Feld <boris.feld@octobus.net>
date Sat, 28 Jul 2018 14:14:59 +0200
parents 195ed920653e
children 8f83a953dddf
files mercurial/debugcommands.py tests/test-debugcommands.t
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Fri Jul 27 19:19:52 2018 +0200
+++ b/mercurial/debugcommands.py	Sat Jul 28 14:14:59 2018 +0200
@@ -2091,6 +2091,8 @@
     ### tracks ways the "delta" are build
     # nodelta
     numempty = 0
+    numemptytext = 0
+    numemptydelta = 0
     # full file content
     numfull = 0
     # delta against previous revision
@@ -2139,6 +2141,7 @@
             chainspans.append(size)
             if size == 0:
                 numempty += 1
+                numemptytext += 1
             else:
                 numfull += 1
                 addsize(size, fullsize)
@@ -2150,6 +2153,7 @@
             chainspans.append((revaddr - baseaddr) + size)
             if size == 0:
                 numempty += 1
+                numemptydelta += 1
             else:
                 addsize(size, deltasize)
                 if delta == rev - 1:
@@ -2226,6 +2230,10 @@
     ui.write(('    normal    : ') + fmt % pcfmt(numrevs - nummerges, numrevs))
     ui.write(('revisions     : ') + fmt2 % numrevs)
     ui.write(('    empty     : ') + fmt % pcfmt(numempty, numrevs))
+    ui.write(('                   text  : ')
+             + fmt % pcfmt(numemptytext, numemptytext + numemptydelta))
+    ui.write(('                   delta : ')
+             + fmt % pcfmt(numemptydelta, numemptytext + numemptydelta))
     ui.write(('    full      : ') + fmt % pcfmt(numfull, numrevs))
     ui.write(('    deltas    : ') + fmt % pcfmt(numdeltas, numrevs))
     ui.write(('revision size : ') + fmt2 % totalsize)
--- a/tests/test-debugcommands.t	Fri Jul 27 19:19:52 2018 +0200
+++ b/tests/test-debugcommands.t	Sat Jul 28 14:14:59 2018 +0200
@@ -24,6 +24,8 @@
       normal    :  3 (100.00%)
   revisions     :  3
       empty     :  1 (33.33%)
+                     text  :  1 (100.00%)
+                     delta :  0 ( 0.00%)
       full      :  2 (66.67%)
       deltas    :  0 ( 0.00%)
   revision size : 88