changeset 49218:5b1495c37b0c

debugdeltachain: distinct between snapshot and "other" diffs Snapshot are expected to be healthy behavior, while "other" is a bit more suspicious. So we distinct between the two to make it easier to inspect repositories.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 18 May 2022 15:55:14 +0100
parents 13dfad0f9f7a
children 0a86cb154e83
files mercurial/debugcommands.py tests/test-upgrade-repo.t
diffstat 2 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Wed May 25 13:28:24 2022 +0200
+++ b/mercurial/debugcommands.py	Wed May 18 15:55:14 2022 +0100
@@ -805,10 +805,12 @@
                 deltatype = b'p1'
             elif e[3] == e[6]:
                 deltatype = b'p2'
+            elif e[3] == rev:
+                deltatype = b'base'
+            elif r.issnapshot(rev):
+                deltatype = b'snap'
             elif e[3] == rev - 1:
                 deltatype = b'prev'
-            elif e[3] == rev:
-                deltatype = b'base'
             else:
                 deltatype = b'other'
         else:
--- a/tests/test-upgrade-repo.t	Wed May 25 13:28:24 2022 +0200
+++ b/tests/test-upgrade-repo.t	Wed May 18 15:55:14 2022 +0100
@@ -1456,7 +1456,7 @@
       rev  chain# chainlen     prev   delta       size    rawsize  chainsize     ratio   lindist extradist extraratio   readsize largestblk rddensity srchunks
         0       1        1       -1    base         77        182         77   0.42308        77         0    0.00000         77         77   1.00000        1
         1       1        2        0      p1         21        191         98   0.51309        98         0    0.00000         98         98   1.00000        1
-        2       1        2        0   other         30        200        107   0.53500       128        21    0.19626        128        128   0.83594        1
+        2       1        2        0    snap         30        200        107   0.53500       128        21    0.19626        128        128   0.83594        1
 
   $ hg debugupgraderepo --run --optimize 're-delta-all'
   upgrade will perform the following actions: