From: Avery Pennarun Date: Thu, 4 Mar 2010 01:35:29 +0000 (-0500) Subject: save-cmd: when verbose=1, print the dirname *before* backing it up. X-Git-Tag: bup-0.12a~7 X-Git-Url: https://arthur.barton.de/gitweb/?a=commitdiff_plain;h=d4b86305b635e3dd9841c18007cdc3b1b3715516;p=bup.git save-cmd: when verbose=1, print the dirname *before* backing it up. It was really misleading showing the most-recently-completed directory, then spending a long time backing up files in a totally different place. --- diff --git a/cmd/save-cmd.py b/cmd/save-cmd.py index 3524115..63c5005 100755 --- a/cmd/save-cmd.py +++ b/cmd/save-cmd.py @@ -132,6 +132,7 @@ if opt.progress or 1: tstart = time.time() count = subcount = fcount = 0 lastskip_name = None +lastdir = '' for (transname,ent) in r.filter(extra, wantrecurse=wantrecurse_during): (dir, file) = os.path.split(ent.name) exists = (ent.flags & index.IX_EXISTS) @@ -147,8 +148,12 @@ for (transname,ent) in r.filter(extra, wantrecurse=wantrecurse_during): status = 'M' else: status = ' ' - if opt.verbose >= 2 or stat.S_ISDIR(ent.mode): + if opt.verbose >= 2: log('%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, ''))) + lastdir = dir if opt.progress: progress_report(0)