changeset 51076:786b6225793a

debug-delta-chain: print less data by default This is faster and simpler to read.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 19 Sep 2023 03:15:12 +0200
parents 2d30d1ba0371
children 45dab30f9d55
files mercurial/debugcommands.py tests/bundles/test-revlog-diff-relative-to-nullrev.sh tests/test-debugcommands.t tests/test-generaldelta.t tests/test-parseindex.t tests/test-revlog.t tests/test-sparse-revlog.t tests/test-upgrade-repo.t
diffstat 8 files changed, 136 insertions(+), 50 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Tue Sep 19 03:00:44 2023 +0200
+++ b/mercurial/debugcommands.py	Tue Sep 19 03:15:12 2023 +0200
@@ -756,7 +756,7 @@
         (
             b'',
             b'all-info',
-            True,
+            False,
             _('compute all information unless specified otherwise'),
         ),
         (
@@ -874,7 +874,7 @@
     if revs_opt:
         revs = [int(r) for r in revs_opt]
 
-    all_info = opts.pop('all_info', True)
+    all_info = opts.pop('all_info', False)
     size_info = opts.pop('size_info', None)
     if size_info is None:
         size_info = all_info
--- a/tests/bundles/test-revlog-diff-relative-to-nullrev.sh	Tue Sep 19 03:00:44 2023 +0200
+++ b/tests/bundles/test-revlog-diff-relative-to-nullrev.sh	Tue Sep 19 03:15:12 2023 +0200
@@ -32,7 +32,7 @@
 hg up null
 echo ha > a
 ../../../hg commit -Am root-A
-../../../hg debugdeltachain a
+../../../hg debugdeltachain a --all-info
 rm -rf .hg/cache/ .hg/wcache/
 cd ..
 
--- a/tests/test-debugcommands.t	Tue Sep 19 03:00:44 2023 +0200
+++ b/tests/test-debugcommands.t	Tue Sep 19 03:15:12 2023 +0200
@@ -205,7 +205,7 @@
 #endif
 
 #if reporevlogstore no-pure
-  $ hg debugdeltachain -m
+  $ hg debugdeltachain -m --all-info
       rev      p1      p2  chain# chainlen     prev   delta       size    rawsize  chainsize     ratio   lindist extradist extraratio   readsize largestblk rddensity srchunks
         0      -1      -1       1        1       -1    base         44         43         44   1.02326        44         0    0.00000         44         44   1.00000        1
         1       0      -1       2        1       -1    base          0          0          0   0.00000         0         0    0.00000          0          0   1.00000        1
@@ -216,7 +216,50 @@
   1 2 1
   2 3 1
 
-  $ hg debugdeltachain -m -Tjson
+  $ hg debugdeltachain -m -Tjson  --size-info
+  [
+   {
+    "chainid": 1,
+    "chainlen": 1,
+    "chainratio": 1.0232558139534884,
+    "chainsize": 44,
+    "compsize": 44,
+    "deltatype": "base",
+    "p1": -1,
+    "p2": -1,
+    "prevrev": -1,
+    "rev": 0,
+    "uncompsize": 43
+   },
+   {
+    "chainid": 2,
+    "chainlen": 1,
+    "chainratio": 0,
+    "chainsize": 0,
+    "compsize": 0,
+    "deltatype": "base",
+    "p1": 0,
+    "p2": -1,
+    "prevrev": -1,
+    "rev": 1,
+    "uncompsize": 0
+   },
+   {
+    "chainid": 3,
+    "chainlen": 1,
+    "chainratio": 1.0232558139534884,
+    "chainsize": 44,
+    "compsize": 44,
+    "deltatype": "base",
+    "p1": 1,
+    "p2": -1,
+    "prevrev": -1,
+    "rev": 2,
+    "uncompsize": 43
+   }
+  ]
+
+  $ hg debugdeltachain -m -Tjson  --all-info
   [
    {
     "chainid": 1,
@@ -286,18 +329,61 @@
   > [experimental]
   > sparse-read = True
   > EOF
-  $ hg debugdeltachain -m
+  $ hg debugdeltachain -m --all-info
       rev      p1      p2  chain# chainlen     prev   delta       size    rawsize  chainsize     ratio   lindist extradist extraratio   readsize largestblk rddensity srchunks
         0      -1      -1       1        1       -1    base         44         43         44   1.02326        44         0    0.00000         44         44   1.00000        1
         1       0      -1       2        1       -1    base          0          0          0   0.00000         0         0    0.00000          0          0   1.00000        1
         2       1      -1       3        1       -1    base         44         43         44   1.02326        44         0    0.00000         44         44   1.00000        1
 
-  $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen} {readsize} {largestblock} {readdensity}\n'
+  $ hg debugdeltachain -m --sparse-info -T '{rev} {chainid} {chainlen} {readsize} {largestblock} {readdensity}\n'
   0 1 1 44 44 1.0
   1 2 1 0 0 1
   2 3 1 44 44 1.0
 
-  $ hg debugdeltachain -m -Tjson
+  $ hg debugdeltachain -m -Tjson --sparse-info
+  [
+   {
+    "chainid": 1,
+    "chainlen": 1,
+    "deltatype": "base",
+    "largestblock": 44,
+    "p1": -1,
+    "p2": -1,
+    "prevrev": -1,
+    "readdensity": 1.0,
+    "readsize": 44,
+    "rev": 0,
+    "srchunks": 1
+   },
+   {
+    "chainid": 2,
+    "chainlen": 1,
+    "deltatype": "base",
+    "largestblock": 0,
+    "p1": 0,
+    "p2": -1,
+    "prevrev": -1,
+    "readdensity": 1,
+    "readsize": 0,
+    "rev": 1,
+    "srchunks": 1
+   },
+   {
+    "chainid": 3,
+    "chainlen": 1,
+    "deltatype": "base",
+    "largestblock": 44,
+    "p1": 1,
+    "p2": -1,
+    "prevrev": -1,
+    "readdensity": 1.0,
+    "readsize": 44,
+    "rev": 2,
+    "srchunks": 1
+   }
+  ]
+
+  $ hg debugdeltachain -m -Tjson --all-info
   [
    {
     "chainid": 1,
@@ -374,7 +460,7 @@
   >   hg ci -m "a default:$i"
   >   hg up -q other
   > done
-  $ hg debugdeltachain a -T '{rev} {srchunks}\n' \
+  $ hg debugdeltachain a -T '{rev} {srchunks}\n'  --all-info\
   >    --config experimental.sparse-read.density-threshold=0.50 \
   >    --config experimental.sparse-read.min-gap-size=0
   0 1
--- a/tests/test-generaldelta.t	Tue Sep 19 03:00:44 2023 +0200
+++ b/tests/test-generaldelta.t	Tue Sep 19 03:15:12 2023 +0200
@@ -74,8 +74,8 @@
   $ cd client
   $ hg pull -q ../server -r 4
   $ hg debugdeltachain x
-      rev      p1      p2  chain# chainlen     prev   delta       size    rawsize  chainsize     ratio   lindist extradist extraratio
-        0      -1      -1       1        1       -1    base          3          2          3   1.50000         3         0    0.00000
+      rev      p1      p2  chain# chainlen     prev   delta
+        0      -1      -1       1        1       -1    base
 
   $ cd ..
 
@@ -104,23 +104,23 @@
   updating to branch default
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg -R repo debugdeltachain -m
-      rev      p1      p2  chain# chainlen     prev   delta       size    rawsize  chainsize     ratio   lindist extradist extraratio
-        0      -1      -1       1        1       -1    base        10?        135        10?   0.7????       10?         0    0.00000 (glob)
-        1       0      -1       1        2        0    prev         57        135        1??   1.?????       16?         0    0.00000 (glob)
-        2       0      -1       1        3        1    prev         57        135        2??   1.6????       2??         0    0.00000 (glob)
-        3       0      -1       2        1       -1    base        104        135        104   0.77037       104         0    0.00000
+      rev      p1      p2  chain# chainlen     prev   delta
+        0      -1      -1       1        1       -1    base
+        1       0      -1       1        2        0    prev
+        2       0      -1       1        3        1    prev
+        3       0      -1       2        1       -1    base
   $ hg -R usegd debugdeltachain -m
-      rev      p1      p2  chain# chainlen     prev   delta       size    rawsize  chainsize     ratio   lindist extradist extraratio
-        0      -1      -1       1        1       -1    base        10?        135        10?   0.7????       10?         0    0.00000 (glob)
-        1       0      -1       1        2        0      p1         57        135        16?   1.?????       16?         0    0.00000 (glob)
-        2       0      -1       1        3        1    prev         57        135        2??   1.6????       2??         0    0.00000 (glob)
-        3       0      -1       1        2        0      p1         57        135        16?   1.?????       27?       114    0.????? (glob)
+      rev      p1      p2  chain# chainlen     prev   delta
+        0      -1      -1       1        1       -1    base
+        1       0      -1       1        2        0      p1
+        2       0      -1       1        3        1    prev
+        3       0      -1       1        2        0      p1
   $ hg -R full debugdeltachain -m
-      rev      p1      p2  chain# chainlen     prev   delta       size    rawsize  chainsize     ratio   lindist extradist extraratio
-        0      -1      -1       1        1       -1    base        10?        135        10?   0.7????       10?         0    0.00000 (glob)
-        1       0      -1       1        2        0      p1         57        135        16?   1.?????       16?         0    0.00000 (glob)
-        2       0      -1       1        2        0      p1         57        135        16?   1.?????       2??        57    0.3???? (glob)
-        3       0      -1       1        2        0      p1         57        135        16?   1.?????       27?       114    0.????? (glob)
+      rev      p1      p2  chain# chainlen     prev   delta
+        0      -1      -1       1        1       -1    base
+        1       0      -1       1        2        0      p1
+        2       0      -1       1        2        0      p1
+        3       0      -1       1        2        0      p1
 
 Test revlog.optimize-delta-parent-choice
 
@@ -140,10 +140,10 @@
   $ hg merge -q 0
   $ hg commit -q -m merge
   $ hg debugdeltachain -m
-      rev      p1      p2  chain# chainlen     prev   delta       size    rawsize  chainsize     ratio   lindist extradist extraratio
-        0      -1      -1       1        1       -1    base         ??        215         ??   0.?????        ??         0    0.00000 (glob)
-        1      -1      -1       1        2        0    prev         ??         86        1??   1.?????       1??         0    0.00000 (glob)
-        2       1       0       1        2        0      p2         ??        301        1??   0.4????       ???        ??    0.5???? (glob)
+      rev      p1      p2  chain# chainlen     prev   delta
+        0      -1      -1       1        1       -1    base
+        1      -1      -1       1        2        0    prev
+        2       1       0       1        2        0      p2
 
   $ hg strip -q -r . --config extensions.strip=
 
@@ -152,10 +152,10 @@
   $ hg merge -q 0
   $ hg commit -q -m merge --config storage.revlog.optimize-delta-parent-choice=yes
   $ hg debugdeltachain -m
-      rev      p1      p2  chain# chainlen     prev   delta       size    rawsize  chainsize     ratio   lindist extradist extraratio
-        0      -1      -1       1        1       -1    base         ??        215         ??   0.?????        ??         0    0.00000 (glob)
-        1      -1      -1       1        2        0    prev         ??         86        1??   1.?????       1??         0    0.00000 (glob)
-        2       1       0       1        2        0      p2         ??        301        1??   0.4????       ???        ??    0.5???? (glob)
+      rev      p1      p2  chain# chainlen     prev   delta
+        0      -1      -1       1        1       -1    base
+        1      -1      -1       1        2        0    prev
+        2       1       0       1        2        0      p2
 
 Test that strip bundle use bundle2
   $ hg --config extensions.strip= strip .
@@ -215,7 +215,7 @@
   0 files updated, 0 files merged, 14 files removed, 0 files unresolved
   $ 
   $ cd ..
-  $ hg -R source-repo debugdeltachain -m
+  $ hg -R source-repo debugdeltachain -m --all-info
       rev      p1      p2  chain# chainlen     prev   delta       size    rawsize  chainsize     ratio   lindist extradist extraratio
         0      -1      -1       1        1       -1    base         46         45         46   1.02222        46         0    0.00000
         1       0      -1       1        2        0      p1         57         90        103   1.14444       103         0    0.00000
@@ -281,7 +281,7 @@
   new changesets 61246295ee1e:c930ac4a5b32
   updating to branch default
   14 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ hg -R relax-chain debugdeltachain -m
+  $ hg -R relax-chain debugdeltachain -m --all-info
       rev      p1      p2  chain# chainlen     prev   delta       size    rawsize  chainsize     ratio   lindist extradist extraratio
         0      -1      -1       1        1       -1    base         46         45         46   1.02222        46         0    0.00000
         1       0      -1       1        2        0      p1         57         90        103   1.14444       103         0    0.00000
@@ -347,7 +347,7 @@
   new changesets 61246295ee1e:c930ac4a5b32
   updating to branch default
   14 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ hg -R noconst-chain debugdeltachain -m
+  $ hg -R noconst-chain debugdeltachain -m --all-info
       rev      p1      p2  chain# chainlen     prev   delta       size    rawsize  chainsize     ratio   lindist extradist extraratio
         0      -1      -1       1        1       -1    base         46         45         46   1.02222        46         0    0.00000
         1       0      -1       1        2        0      p1         57         90        103   1.14444       103         0    0.00000
--- a/tests/test-parseindex.t	Tue Sep 19 03:00:44 2023 +0200
+++ b/tests/test-parseindex.t	Tue Sep 19 03:15:12 2023 +0200
@@ -155,9 +155,9 @@
        1 0000       65      1      0      2 26333235a41c
 
   $ hg -R limit debugdeltachain -c
-      rev      p1      p2  chain# chainlen     prev   delta       size    rawsize  chainsize     ratio   lindist extradist extraratio
-        0       2      -1       1        1       -1    base         63         62         63   1.01613        63         0    0.00000
-        1       0       2       2        1       -1    base         66         65         66   1.01538        66         0    0.00000
+      rev      p1      p2  chain# chainlen     prev   delta
+        0       2      -1       1        1       -1    base
+        1       0       2       2        1       -1    base
 
   $ hg -R neglimit debugrevlogindex -f1 -c
      rev flag     size   link     p1     p2       nodeid
@@ -170,9 +170,9 @@
        1 0000       65      1      0  65536 26333235a41c
 
   $ hg -R segv debugdeltachain -c
-      rev      p1      p2  chain# chainlen     prev   delta       size    rawsize  chainsize     ratio   lindist extradist extraratio
-        0   65536      -1       1        1       -1    base         63         62         63   1.01613        63         0    0.00000
-        1       0   65536       2        1       -1    base         66         65         66   1.01538        66         0    0.00000
+      rev      p1      p2  chain# chainlen     prev   delta
+        0   65536      -1       1        1       -1    base
+        1       0   65536       2        1       -1    base
 
   $ cat <<EOF > test.py
   > import sys
--- a/tests/test-revlog.t	Tue Sep 19 03:00:44 2023 +0200
+++ b/tests/test-revlog.t	Tue Sep 19 03:15:12 2023 +0200
@@ -76,10 +76,10 @@
   $ tar -xf - < "$TESTDIR"/bundles/test-revlog-diff-relative-to-nullrev.tar
   $ cd nullrev-diff
   $ hg debugdeltachain a
-      rev      p1      p2  chain# chainlen     prev   delta       size    rawsize  chainsize     ratio   lindist extradist extraratio   readsize largestblk rddensity srchunks
-        0      -1      -1       1        2       -1      p1         15          3         15   5.00000        15         0    0.00000         15         15   1.00000        1
-        1       0      -1       1        2       -1      p2         15          3         15   5.00000        30        15    1.00000         30         30   0.50000        1
-        2      -1      -1       1        2       -1      p1         15          3         15   5.00000        45        30    2.00000         45         45   0.33333        1
+      rev      p1      p2  chain# chainlen     prev   delta
+        0      -1      -1       1        2       -1      p1
+        1       0      -1       1        2       -1      p2
+        2      -1      -1       1        2       -1      p1
   $ hg cat --config rhg.cat=true -r 0 a
   hi
   $ hg cat --config rhg.cat=true -r 1 a
--- a/tests/test-sparse-revlog.t	Tue Sep 19 03:00:44 2023 +0200
+++ b/tests/test-sparse-revlog.t	Tue Sep 19 03:15:12 2023 +0200
@@ -161,7 +161,7 @@
   $ ls -1
   SPARSE-REVLOG-TEST-FILE
   $ hg debugdeltachain SPARSE-REVLOG-TEST-FILE | grep snap | tail -1
-     4971    4970      -1       3        5     4930    snap      19179     346472     427596   1.23414  15994877  15567281   36.40652     427596     179288   1.00000        5
+     4971    4970      -1       3        5     4930    snap
   $ hg debug-delta-find SPARSE-REVLOG-TEST-FILE 4971
   DBG-DELTAS-SEARCH: SEARCH rev=4971
   DBG-DELTAS-SEARCH: ROUND #1 - 1 candidates - search-down
--- a/tests/test-upgrade-repo.t	Tue Sep 19 03:00:44 2023 +0200
+++ b/tests/test-upgrade-repo.t	Tue Sep 19 03:15:12 2023 +0200
@@ -1427,7 +1427,7 @@
   $ hg config format
   format.revlog-compression=$BUNDLE2_COMPRESSIONS$
   format.maxchainlen=9001
-  $ hg debugdeltachain file
+  $ hg debugdeltachain file --all-info
       rev      p1      p2  chain# chainlen     prev   delta       size    rawsize  chainsize     ratio   lindist extradist extraratio   readsize largestblk rddensity srchunks
         0      -1      -1       1        1       -1    base         77        182         77   0.42308        77         0    0.00000         77         77   1.00000        1
         1       0      -1       1        2        0      p1         21        191         98   0.51309        98         0    0.00000         98         98   1.00000        1
@@ -1475,7 +1475,7 @@
   removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
   copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
   the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
-  $ hg debugdeltachain file
+  $ hg debugdeltachain file --all-info
       rev      p1      p2  chain# chainlen     prev   delta       size    rawsize  chainsize     ratio   lindist extradist extraratio   readsize largestblk rddensity srchunks
         0      -1      -1       1        1       -1    base         77        182         77   0.42308        77         0    0.00000         77         77   1.00000        1
         1       0      -1       1        2        0      p1         21        191         98   0.51309        98         0    0.00000         98         98   1.00000        1