Tweaked dbgmtree.py -Z flag to include mroots as depth

This helps debug a corrupted mtree with cycles, which has been a problem
in the past.

Also fixed a small rendering issue with dbgmtree.py not connecting inner
tree edges to mdir roots correctly during rendering.
This commit is contained in:
Christopher Haster
2023-06-01 13:16:32 -05:00
parent 49ec7a12b9
commit 2339e9865f
2 changed files with 190 additions and 160 deletions
+1 -2
View File
@@ -556,7 +556,6 @@ def main(disk, roots=None, *,
t_width = 0
if args.get('tree'):
# find the max depth of each layer to nicely align trees
# TODO memoize
bdepths = {}
bid = -1
while True:
@@ -640,7 +639,7 @@ def main(disk, roots=None, *,
# remap branches to leaves if we aren't showing inner branches
if not args.get('inner'):
# step through each layer backwards
b_depth = max((branch.a[1]+1 for branch in tree), default=0)
b_depth = max((branch.b[1]+1 for branch in tree), default=0)
# keep track of the original bids, unfortunately because we
# store the bids in the branches we overwrite these