comparison mercurial/revlogutils/debug.py @ 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
comparison
equal deleted inserted replaced
49262:4c145006b24a 49263:27583efef74d
134 134
135 135
136 @debug_column(b"chunk-size", size=10, verbose=True) 136 @debug_column(b"chunk-size", size=10, verbose=True)
137 def data_chunk_size(index, rev, entry, hexfn): 137 def data_chunk_size(index, rev, entry, hexfn):
138 return b"%d" % entry[constants.ENTRY_DATA_COMPRESSED_LENGTH] 138 return b"%d" % entry[constants.ENTRY_DATA_COMPRESSED_LENGTH]
139
140
141 @debug_column(b"sd-comp-mode", size=7, verbose=True)
142 def sidedata_compression_mode(index, rev, entry, hexfn):
143 compression = entry[constants.ENTRY_SIDEDATA_COMPRESSION_MODE]
144 if compression == constants.COMP_MODE_PLAIN:
145 return b"plain"
146 elif compression == constants.COMP_MODE_DEFAULT:
147 return b"default"
148 elif compression == constants.COMP_MODE_INLINE:
149 return b"inline"
150 else:
151 return b"%d" % compression
139 152
140 153
141 def debug_index( 154 def debug_index(
142 ui, 155 ui,
143 repo, 156 repo,