]> arthur.barton.de Git - bup.git/commitdiff
save-cmd: when verbose=1, print the dirname *before* backing it up.
authorAvery Pennarun <apenwarr@gmail.com>
Thu, 4 Mar 2010 01:35:29 +0000 (20:35 -0500)
committerAvery Pennarun <apenwarr@gmail.com>
Thu, 4 Mar 2010 01:55:29 +0000 (20:55 -0500)
It was really misleading showing the most-recently-completed directory, then
spending a long time backing up files in a totally different place.

cmd/save-cmd.py

index 3524115989a8476b2d0b0d1835ed0890a348c7b6..63c500516aec70cdf968bf295feedc0a692e8189 100755 (executable)
@@ -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)