scripts: Tweaked mdir/shrub address printing

This fixes an issue where shrub trunks were never printed even with
-i/--internal.

While only showing mdir/shrub/btree/bptr addresses on block changes is
nice in theory, it results in shrub trunks never being printed because
the mdir -> shrub block doesn't change.

Also checking for changes in block type avoids this.
This commit is contained in:
Christopher Haster
2025-04-01 14:16:04 -05:00
parent f550fa9a80
commit 27370dec66
3 changed files with 31 additions and 30 deletions

View File

@@ -1732,7 +1732,7 @@ def main(disk, roots=None, *,
# dynamically size the id field
w_width = mt.ceil(mt.log10(max(1, btree.weight)+1))
# prbyd here means the last rendered rbyd, we update
# prbyd keeps track of the last rendered rbyd, we update
# in dbg_branch to always print interleaved addresses
prbyd = None
def dbg_branch(d, bid, rbyd, rid, name):
@@ -1797,7 +1797,7 @@ def main(disk, roots=None, *,
'\x1b[31m' if color else '',
'(corrupted rbyd %s)' % rbyd.addr(),
'\x1b[m' if color else ''))
prbyd = rbyd
prbyd = None
corrupted = True
continue