redo-log: correctly indent first level of recursion.

We don't want to print "-" at all, but that doesn't mean we should
always omit indentation for the first level.
This commit is contained in:
Avery Pennarun 2018-11-17 01:39:10 -05:00
commit e10bd1a9eb

View file

@ -61,13 +61,14 @@ def is_locked(fid):
def _fix_depth(): def _fix_depth():
vars.DEPTH = (len(depth) - 1) * ' ' vars.DEPTH = len(depth) * ' '
def catlog(t): def catlog(t):
global total_lines, status global total_lines, status
if t in already: if t in already:
return return
if t != '-':
depth.append(t) depth.append(t)
_fix_depth() _fix_depth()
already.add(t) already.add(t)
@ -181,6 +182,7 @@ def catlog(t):
if line_head: if line_head:
# partial line never got terminated # partial line never got terminated
print line_head print line_head
if t != '-':
assert(depth[-1] == t) assert(depth[-1] == t)
depth.pop(-1) depth.pop(-1)
_fix_depth() _fix_depth()