]> arthur.barton.de Git - bup.git/commitdiff
Bloom filter & server index: Hide some progress messages cleanup-messages
authorAlexander Barton <alex@barton.de>
Thu, 9 Apr 2015 16:42:59 +0000 (18:42 +0200)
committerAlexander Barton <alex@barton.de>
Thu, 9 Apr 2015 16:42:59 +0000 (18:42 +0200)
The change for the server index is unproblematic, I think, but
the hidden bloom message results in "bup bloom --dir" (which
"bup save" calls) to exit without a message -- but makes "bup save"
much nicer ... hm.

Can we check if "bup bloom" has been called by "bup save"?

cmd/bloom-cmd.py
lib/bup/client.py

index 4ca9ef11b4e93b73ad828fa8ed54a28800987357..20c6d71a757ce110e92ea6c70703d2327fc8ffcb 100755 (executable)
@@ -127,6 +127,13 @@ def do_bloom(path, outfilename):
     if tfname:
         os.rename(tfname, outfilename)
 
+    if opt.dir:
+        # Hide progress message when using "--dir", which "bup save" does ...
+        progress_update('Bloom filter: %s%s %d file%s (%d object%s), done.'
+            % (dirprefix, msg,
+               len(add), len(add)!=1 and 's' or '',
+               add_count, add_count!=1 and 's' or ''))
+        return
     progress_end('Bloom filter: %s%s %d file%s (%d object%s), done.'
         % (dirprefix, msg,
            len(add), len(add)!=1 and 's' or '',
index 3feea453933da34dd5c862055340a92347340c80..1f9ccf986240dd6c0e521567d26c7cd6fefe1f7b 100644 (file)
@@ -196,7 +196,7 @@ class Client:
                 f.write(b)
                 count += len(b)
                 progress_update('Receiving index from server: %d/%d ...' % (count, n), False)
-            progress_end('Receiving index from server: %d/%d, done.' % (count, n))
+            progress_update('Receiving index from server: %d/%d, done.' % (count, n))
             self.check_ok()
 
     def _make_objcache(self):