]> arthur.barton.de Git - bup.git/commitdiff
bup index: fix progress message printing when using -v.
authorAvery Pennarun <apenwarr@gmail.com>
Thu, 4 Feb 2010 23:58:40 +0000 (18:58 -0500)
committerAvery Pennarun <apenwarr@gmail.com>
Thu, 4 Feb 2010 23:58:40 +0000 (18:58 -0500)
It wasn't printing often enough, and thus was absent more often than
present.

cmd-index.py

index da0bda760ec7452ce99382f0e7923cc4f5aff554..c64f8f20c2a269364be1e3d2cc686fa405def434 100755 (executable)
@@ -89,12 +89,13 @@ def update_index(top):
     total = 0
     for (path,pst) in drecurse.recursive_dirlist([top], xdev=opt.xdev):
         #log('got: %r\n' % path)
-        if not (total % 128):
-            progress('Indexing: %d\r' % total)
-        total += 1
         if opt.verbose>=2 or (opt.verbose==1 and stat.S_ISDIR(pst.st_mode)):
             sys.stdout.write('%s\n' % path)
             sys.stdout.flush()
+            progress('Indexing: %d\r' % total)
+        elif not (total % 128):
+            progress('Indexing: %d\r' % total)
+        total += 1
         while rig.cur and rig.cur.name > path:  # deleted paths
             rig.cur.set_deleted()
             rig.cur.repack()