Mercurial > hg
changeset 49263:27583efef74d
debugindex: add a `sd-comp-mode` column
author | Pierre-Yves DAVID <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 01 Jun 2022 01:34:43 +0200 |
parents | 4c145006b24a |
children | e3a267a93711 |
files | mercurial/revlogutils/debug.py tests/test-debugcommands.t tests/test-sidedata.t |
diffstat | 3 files changed, 31 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/revlogutils/debug.py Wed Jun 01 01:33:36 2022 +0200 +++ b/mercurial/revlogutils/debug.py Wed Jun 01 01:34:43 2022 +0200 @@ -138,6 +138,19 @@ return b"%d" % entry[constants.ENTRY_DATA_COMPRESSED_LENGTH] +@debug_column(b"sd-comp-mode", size=7, verbose=True) +def sidedata_compression_mode(index, rev, entry, hexfn): + compression = entry[constants.ENTRY_SIDEDATA_COMPRESSION_MODE] + if compression == constants.COMP_MODE_PLAIN: + return b"plain" + elif compression == constants.COMP_MODE_DEFAULT: + return b"default" + elif compression == constants.COMP_MODE_INLINE: + return b"inline" + else: + return b"%d" % compression + + def debug_index( ui, repo,
--- a/tests/test-debugcommands.t Wed Jun 01 01:33:36 2022 +0200 +++ b/tests/test-debugcommands.t Wed Jun 01 01:34:43 2022 +0200 @@ -153,26 +153,26 @@ 1 1 8cccb4b5fec2 07f494440405 000000000000 2 2 b1e228c512c5 8cccb4b5fec2 000000000000 $ hg debugindex -c --debug - rev linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size - 0 0 07f4944404050f47db2e5c5071e0e84e7a27bba9 -1 0000000000000000000000000000000000000000 -1 0000000000000000000000000000000000000000 57 0 0 2 0 58 - 1 1 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a 0 07f4944404050f47db2e5c5071e0e84e7a27bba9 -1 0000000000000000000000000000000000000000 66 1 0 2 58 67 - 2 2 b1e228c512c5d7066d70562ed839c3323a62d6d2 1 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a -1 0000000000000000000000000000000000000000 65 2 0 2 125 66 + rev linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size sd-comp-mode + 0 0 07f4944404050f47db2e5c5071e0e84e7a27bba9 -1 0000000000000000000000000000000000000000 -1 0000000000000000000000000000000000000000 57 0 0 2 0 58 inline + 1 1 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a 0 07f4944404050f47db2e5c5071e0e84e7a27bba9 -1 0000000000000000000000000000000000000000 66 1 0 2 58 67 inline + 2 2 b1e228c512c5d7066d70562ed839c3323a62d6d2 1 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a -1 0000000000000000000000000000000000000000 65 2 0 2 125 66 inline $ hg debugindex -m rev linkrev nodeid p1-nodeid p2-nodeid 0 0 a0c8bcbbb45c 000000000000 000000000000 1 1 57faf8a737ae a0c8bcbbb45c 000000000000 2 2 a35b10320954 57faf8a737ae 000000000000 $ hg debugindex -m --debug - rev linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size - 0 0 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 -1 0000000000000000000000000000000000000000 -1 0000000000000000000000000000000000000000 43 0 0 2 0 44 - 1 1 57faf8a737ae7faf490582941a82319ba6529dca 0 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 -1 0000000000000000000000000000000000000000 0 1 0 2 44 0 - 2 2 a35b103209548032201c16c7688cb2657f037a38 1 57faf8a737ae7faf490582941a82319ba6529dca -1 0000000000000000000000000000000000000000 43 2 0 2 44 44 + rev linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size sd-comp-mode + 0 0 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 -1 0000000000000000000000000000000000000000 -1 0000000000000000000000000000000000000000 43 0 0 2 0 44 inline + 1 1 57faf8a737ae7faf490582941a82319ba6529dca 0 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 -1 0000000000000000000000000000000000000000 0 1 0 2 44 0 inline + 2 2 a35b103209548032201c16c7688cb2657f037a38 1 57faf8a737ae7faf490582941a82319ba6529dca -1 0000000000000000000000000000000000000000 43 2 0 2 44 44 inline $ hg debugindex a rev linkrev nodeid p1-nodeid p2-nodeid 0 0 b789fdd96dc2 000000000000 000000000000 $ hg debugindex --debug a - rev linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size - 0 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 -1 0000000000000000000000000000000000000000 -1 0000000000000000000000000000000000000000 2 0 0 2 0 3 + rev linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size sd-comp-mode + 0 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 -1 0000000000000000000000000000000000000000 -1 0000000000000000000000000000000000000000 2 0 0 2 0 3 inline debugdelta chain basic output
--- a/tests/test-sidedata.t Wed Jun 01 01:33:36 2022 +0200 +++ b/tests/test-sidedata.t Wed Jun 01 01:34:43 2022 +0200 @@ -41,16 +41,16 @@ entry-0002 size 32 $ hg debug-revlog-index --verbose -c - rev linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size - 0 0 7049e48789d7 -1 000000000000 -1 000000000000 54 0 0 0 0 54 - 1 1 2707720c6597 0 7049e48789d7 -1 000000000000 54 1 0 0 54 54 - 2 2 40f977031323 1 2707720c6597 -1 000000000000 55 2 0 0 108 55 + rev linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size sd-comp-mode + 0 0 7049e48789d7 -1 000000000000 -1 000000000000 54 0 0 0 0 54 plain + 1 1 2707720c6597 0 7049e48789d7 -1 000000000000 54 1 0 0 54 54 plain + 2 2 40f977031323 1 2707720c6597 -1 000000000000 55 2 0 0 108 55 plain $ hg debug-revlog-index --verbose -m - rev linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size - 0 0 b85d294330e3 -1 000000000000 -1 000000000000 43 0 0 0 0 43 - 1 1 1a0aec305c63 0 b85d294330e3 -1 000000000000 86 0 0 0 43 55 - 2 2 104258a4f75f 1 1a0aec305c63 -1 000000000000 86 1 0 0 98 55 + rev linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size sd-comp-mode + 0 0 b85d294330e3 -1 000000000000 -1 000000000000 43 0 0 0 0 43 plain + 1 1 1a0aec305c63 0 b85d294330e3 -1 000000000000 86 0 0 0 43 55 plain + 2 2 104258a4f75f 1 1a0aec305c63 -1 000000000000 86 1 0 0 98 55 plain Check upgrade behavior ======================