From e10bd1a9eb07abafbd5cfc0c8ad3cc291a0a6fdc Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Sat, 17 Nov 2018 01:39:10 -0500 Subject: [PATCH] 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. --- redo-log.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/redo-log.py b/redo-log.py index 8aec98d..d5608ae 100755 --- a/redo-log.py +++ b/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: