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:
parent
5c4f710f4e
commit
e10bd1a9eb
1 changed files with 6 additions and 4 deletions
10
redo-log.py
10
redo-log.py
|
|
@ -61,14 +61,15 @@ def is_locked(fid):
|
|||
|
||||
|
||||
def _fix_depth():
|
||||
vars.DEPTH = (len(depth) - 1) * ' '
|
||||
vars.DEPTH = len(depth) * ' '
|
||||
|
||||
|
||||
def catlog(t):
|
||||
global total_lines, status
|
||||
if t in already:
|
||||
return
|
||||
depth.append(t)
|
||||
if t != '-':
|
||||
depth.append(t)
|
||||
_fix_depth()
|
||||
already.add(t)
|
||||
if t == '-':
|
||||
|
|
@ -181,8 +182,9 @@ def catlog(t):
|
|||
if line_head:
|
||||
# partial line never got terminated
|
||||
print line_head
|
||||
assert(depth[-1] == t)
|
||||
depth.pop(-1)
|
||||
if t != '-':
|
||||
assert(depth[-1] == t)
|
||||
depth.pop(-1)
|
||||
_fix_depth()
|
||||
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue