mercurial/revlogutils/debug.py
changeset 49662 7aea9babac5d
parent 49661 511106bcb16c
child 49676 4302db0f54c8
--- a/mercurial/revlogutils/debug.py	Mon Nov 07 14:38:52 2022 -0500
+++ b/mercurial/revlogutils/debug.py	Mon Nov 21 15:04:19 2022 +0100
@@ -288,6 +288,8 @@
     if not flags:
         flags = [b'(none)']
 
+    ### the total size of stored content if incompressed.
+    full_text_total_size = 0
     ### tracks merge vs single parent
     nummerges = 0
 
@@ -347,7 +349,9 @@
         p1, p2 = r.parentrevs(rev)
         delta = r.deltaparent(rev)
         if format > 0:
-            addsize(r.rawsize(rev), datasize)
+            s = r.rawsize(rev)
+            full_text_total_size += s
+            addsize(s, datasize)
         if p2 != nodemod.nullrev:
             nummerges += 1
         size = r.length(rev)
@@ -536,6 +540,18 @@
         ui.write(fmt % pcfmt(chunktypesizes[chunktype], totalsize))
 
     ui.write(b'\n')
+    b_total = b"%d" % full_text_total_size
+    p_total = []
+    while len(b_total) > 3:
+        p_total.append(b_total[-3:])
+        b_total = b_total[:-3]
+    p_total.append(b_total)
+    p_total.reverse()
+    b_total = b' '.join(p_total)
+
+    ui.write(b'\n')
+    ui.writenoi18n(b'total-stored-content: %s bytes\n' % b_total)
+    ui.write(b'\n')
     fmt = dfmtstr(max(avgchainlen, maxchainlen, maxchainspan, compratio))
     ui.writenoi18n(b'avg chain length  : ' + fmt % avgchainlen)
     ui.writenoi18n(b'max chain length  : ' + fmt % maxchainlen)