debugrevlog: display details about empty revision
authorBoris Feld <boris.feld@octobus.net>
Sat, 28 Jul 2018 14:14:59 +0200
changeset 39082 a456c603a83d
parent 39081 195ed920653e
child 39083 8f83a953dddf
debugrevlog: display details about empty revision We now display details about the course of emptiness (empty text or empty delta).
mercurial/debugcommands.py
tests/test-debugcommands.t
--- 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