scripts: Reverted skipped branches in -t/--tree render
The inconsistency between inner/non-inner (-i/--inner) views was a bit too confusing. At least now the bptr rendering in dbglfs.py matches behavior, showing the bptr tag -> bptr jump even when not showing inner nodes. If the point of these renderers is to show all jumps necessary to reach a given piece of data, hiding bptr jumps only sometimes is somewhat counterproductive...
This commit is contained in:
+2
-3
@@ -1475,8 +1475,7 @@ class Btree:
|
|||||||
|
|
||||||
rtree = rtrees[rbyd]
|
rtree = rtrees[rbyd]
|
||||||
rdepth = max((t.depth+1 for t in rtree), default=0)
|
rdepth = max((t.depth+1 for t in rtree), default=0)
|
||||||
d = sum(rdepths[d]+(1 if inner or args.get('tree_rbyd') else 0)
|
d = sum(rdepths[d]+1 for d in range(len(path)))
|
||||||
for d in range(len(path)))
|
|
||||||
|
|
||||||
# map into our btree space
|
# map into our btree space
|
||||||
for t in rtree:
|
for t in rtree:
|
||||||
@@ -1493,7 +1492,7 @@ class Btree:
|
|||||||
t.color))
|
t.color))
|
||||||
|
|
||||||
# connect rbyd branches to rbyd roots
|
# connect rbyd branches to rbyd roots
|
||||||
if path and (inner or args.get('tree_rbyd')):
|
if path:
|
||||||
l_bid, l_rbyd, l_rid, l_name = path[-1]
|
l_bid, l_rbyd, l_rid, l_name = path[-1]
|
||||||
l_branch = l_rbyd.lookup(l_rid, TAG_BRANCH, 0x3)
|
l_branch = l_rbyd.lookup(l_rid, TAG_BRANCH, 0x3)
|
||||||
|
|
||||||
|
|||||||
+5
-13
@@ -1524,8 +1524,7 @@ class Btree:
|
|||||||
|
|
||||||
rtree = rtrees[rbyd]
|
rtree = rtrees[rbyd]
|
||||||
rdepth = max((t.depth+1 for t in rtree), default=0)
|
rdepth = max((t.depth+1 for t in rtree), default=0)
|
||||||
d = sum(rdepths[d]+(1 if inner or args.get('tree_rbyd') else 0)
|
d = sum(rdepths[d]+1 for d in range(len(path)))
|
||||||
for d in range(len(path)))
|
|
||||||
|
|
||||||
# map into our btree space
|
# map into our btree space
|
||||||
for t in rtree:
|
for t in rtree:
|
||||||
@@ -1542,7 +1541,7 @@ class Btree:
|
|||||||
t.color))
|
t.color))
|
||||||
|
|
||||||
# connect rbyd branches to rbyd roots
|
# connect rbyd branches to rbyd roots
|
||||||
if path and (inner or args.get('tree_rbyd')):
|
if path:
|
||||||
l_bid, l_rbyd, l_rid, l_name = path[-1]
|
l_bid, l_rbyd, l_rid, l_name = path[-1]
|
||||||
l_branch = l_rbyd.lookup(l_rid, TAG_BRANCH, 0x3)
|
l_branch = l_rbyd.lookup(l_rid, TAG_BRANCH, 0x3)
|
||||||
|
|
||||||
@@ -2535,11 +2534,7 @@ class Mtree:
|
|||||||
|
|
||||||
rtree = rtrees[rbyd]
|
rtree = rtrees[rbyd]
|
||||||
rdepth = max((t.depth+1 for t in rtree), default=0)
|
rdepth = max((t.depth+1 for t in rtree), default=0)
|
||||||
d = sum(rdepths[d]
|
d = sum(rdepths[d]+1 for d, p in enumerate(path))
|
||||||
+ (1 if inner
|
|
||||||
or args.get('tree_rbyd')
|
|
||||||
or isinstance(p[1], Mdir) else 0)
|
|
||||||
for d, p in enumerate(path))
|
|
||||||
|
|
||||||
# map into our mtree space
|
# map into our mtree space
|
||||||
for t in rtree:
|
for t in rtree:
|
||||||
@@ -2566,9 +2561,7 @@ class Mtree:
|
|||||||
t.color))
|
t.color))
|
||||||
|
|
||||||
# connect rbyd branches to rbyd roots
|
# connect rbyd branches to rbyd roots
|
||||||
if path and (inner
|
if path:
|
||||||
or args.get('tree_rbyd')
|
|
||||||
or isinstance(path[-1][1], Mdir)):
|
|
||||||
# figure out branch mid/attr
|
# figure out branch mid/attr
|
||||||
if isinstance(path[-1][1], Mdir):
|
if isinstance(path[-1][1], Mdir):
|
||||||
l_mid, l_mdir, l_name = path[-1]
|
l_mid, l_mdir, l_name = path[-1]
|
||||||
@@ -3836,8 +3829,7 @@ class Lfs:
|
|||||||
a = (pos, len(path)-1, data.tag)
|
a = (pos, len(path)-1, data.tag)
|
||||||
b = (pos, len(path), data.tag)
|
b = (pos, len(path), data.tag)
|
||||||
bptrs[a] = b
|
bptrs[a] = b
|
||||||
if args.get('inner'):
|
tree.add(TreeBranch(a, b, t_depth))
|
||||||
tree.add(TreeBranch(a, b, t_depth))
|
|
||||||
|
|
||||||
# if we're not showing inner branches, nudge bptr tags to
|
# if we're not showing inner branches, nudge bptr tags to
|
||||||
# their bptrs
|
# their bptrs
|
||||||
|
|||||||
+4
-11
@@ -1490,8 +1490,7 @@ class Btree:
|
|||||||
|
|
||||||
rtree = rtrees[rbyd]
|
rtree = rtrees[rbyd]
|
||||||
rdepth = max((t.depth+1 for t in rtree), default=0)
|
rdepth = max((t.depth+1 for t in rtree), default=0)
|
||||||
d = sum(rdepths[d]+(1 if inner or args.get('tree_rbyd') else 0)
|
d = sum(rdepths[d]+1 for d in range(len(path)))
|
||||||
for d in range(len(path)))
|
|
||||||
|
|
||||||
# map into our btree space
|
# map into our btree space
|
||||||
for t in rtree:
|
for t in rtree:
|
||||||
@@ -1508,7 +1507,7 @@ class Btree:
|
|||||||
t.color))
|
t.color))
|
||||||
|
|
||||||
# connect rbyd branches to rbyd roots
|
# connect rbyd branches to rbyd roots
|
||||||
if path and (inner or args.get('tree_rbyd')):
|
if path:
|
||||||
l_bid, l_rbyd, l_rid, l_name = path[-1]
|
l_bid, l_rbyd, l_rid, l_name = path[-1]
|
||||||
l_branch = l_rbyd.lookup(l_rid, TAG_BRANCH, 0x3)
|
l_branch = l_rbyd.lookup(l_rid, TAG_BRANCH, 0x3)
|
||||||
|
|
||||||
@@ -2501,11 +2500,7 @@ class Mtree:
|
|||||||
|
|
||||||
rtree = rtrees[rbyd]
|
rtree = rtrees[rbyd]
|
||||||
rdepth = max((t.depth+1 for t in rtree), default=0)
|
rdepth = max((t.depth+1 for t in rtree), default=0)
|
||||||
d = sum(rdepths[d]
|
d = sum(rdepths[d]+1 for d, p in enumerate(path))
|
||||||
+ (1 if inner
|
|
||||||
or args.get('tree_rbyd')
|
|
||||||
or isinstance(p[1], Mdir) else 0)
|
|
||||||
for d, p in enumerate(path))
|
|
||||||
|
|
||||||
# map into our mtree space
|
# map into our mtree space
|
||||||
for t in rtree:
|
for t in rtree:
|
||||||
@@ -2532,9 +2527,7 @@ class Mtree:
|
|||||||
t.color))
|
t.color))
|
||||||
|
|
||||||
# connect rbyd branches to rbyd roots
|
# connect rbyd branches to rbyd roots
|
||||||
if path and (inner
|
if path:
|
||||||
or args.get('tree_rbyd')
|
|
||||||
or isinstance(path[-1][1], Mdir)):
|
|
||||||
# figure out branch mid/attr
|
# figure out branch mid/attr
|
||||||
if isinstance(path[-1][1], Mdir):
|
if isinstance(path[-1][1], Mdir):
|
||||||
l_mid, l_mdir, l_name = path[-1]
|
l_mid, l_mdir, l_name = path[-1]
|
||||||
|
|||||||
Reference in New Issue
Block a user