From 0a6105bc937fb2846cebe8d7a9dc9d358237163e Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Wed, 8 Sep 2010 01:23:53 -0700 Subject: [PATCH] cmd/save: always print a progress() message after a log() message. An earlier commit (634df2f8b26a1439f22dc9f6a23d55a006bf0429) made 'bup save' update the progress line much less frequently. Unfortunately, if you used -v or -vv, this would mean that there was *no* progress bar for a short time after every log() message (directory or filename). That made the progress bar flicker annoyingly. To fix it, make sure we reset the progress bar timer after every filename we print with log(). It's subtle, but it makes a very visible difference. Signed-off-by: Avery Pennarun --- cmd/save-cmd.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/save-cmd.py b/cmd/save-cmd.py index 23bcabc..b1376b9 100755 --- a/cmd/save-cmd.py +++ b/cmd/save-cmd.py @@ -115,6 +115,12 @@ def progress_report(n): lastprint = now +def vlog(s): + global lastprint + lastprint = 0 + log(s) + + r = index.Reader(git.repo('bupindex')) def already_saved(ent): @@ -162,10 +168,10 @@ for (transname,ent) in r.filter(extra, wantrecurse=wantrecurse_during): else: status = ' ' if opt.verbose >= 2: - log('%s %-70s\n' % (status, ent.name)) + vlog('%s %-70s\n' % (status, ent.name)) elif not stat.S_ISDIR(ent.mode) and lastdir != dir: if not lastdir.startswith(dir): - log('%s %-70s\n' % (status, os.path.join(dir, ''))) + vlog('%s %-70s\n' % (status, os.path.join(dir, ''))) lastdir = dir if opt.progress: -- 2.39.2