]> arthur.barton.de Git - bup.git/commitdiff
midx/bloom: use progress() and debug1() for non-critical messages
authorGabriel Filion <lelutin@gmail.com>
Fri, 25 Feb 2011 16:16:05 +0000 (11:16 -0500)
committerAvery Pennarun <apenwarr@gmail.com>
Sat, 26 Feb 2011 08:59:03 +0000 (00:59 -0800)
Some messages in these two commands indicate progress but are not
filtered out when the command is not run under a tty. This makes bup
return some unwanted messages when run under cron.

Using progress() and debug1() instead should fix that.

(Changed a few from progress() to debug1() by apenwarr.)

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
cmd/bloom-cmd.py
cmd/midx-cmd.py

index 02b0a106682633ed2163fc9c289523d8f3669d22..51e594bdf11784c24c63ac60714b7f9b85d0017b 100755 (executable)
@@ -81,14 +81,14 @@ def do_bloom(path, outfilename):
 
     if b:
         if len(b) != rest_count:
-            log("bloom: size %d != idx total %d, regenerating\n"
-                    % (len(b), rest_count))
+            debug1("bloom: size %d != idx total %d, regenerating\n"
+                   % (len(b), rest_count))
             b = None
         elif (b.bits < bloom.MAX_BLOOM_BITS and
               b.pfalse_positive(add_count) > bloom.MAX_PFALSE_POSITIVE):
-            log("bloom: regenerating: adding %d entries gives "
-                "%.2f%% false positives.\n"
-                    % (add_count, b.pfalse_positive(add_count)))
+            debug1("bloom: regenerating: adding %d entries gives "
+                   "%.2f%% false positives.\n"
+                   % (add_count, b.pfalse_positive(add_count)))
             b = None
         else:
             b = bloom.ShaBloom(outfilename, readwrite=True, expected=add_count)
@@ -101,7 +101,7 @@ def do_bloom(path, outfilename):
     msg = b is None and 'creating from' or 'adding'
     if not _first: _first = path
     dirprefix = (_first != path) and git.repo_rel(path)+': ' or ''
-    log('bloom: %s%s %d file%s (%d object%s).\n'
+    progress('bloom: %s%s %d file%s (%d object%s).\n'
         % (dirprefix, msg,
            len(add), len(add)!=1 and 's' or '',
            add_count, add_count!=1 and 's' or ''))
index 8e8fbcac5b59e2d3285020f85a1267af61f97dba..38a5fdfca500639894111181edeb3a1007aea38a 100755 (executable)
@@ -97,8 +97,8 @@ def _do_midx(outdir, outfilename, infilenames, prefixstr):
 
     if not _first: _first = outdir
     dirprefix = (_first != outdir) and git.repo_rel(outdir)+': ' or ''
-    log('midx: %s%screating from %d files (%d objects).\n'
-        % (dirprefix, prefixstr, len(infilenames), total))
+    debug1('midx: %s%screating from %d files (%d objects).\n'
+           % (dirprefix, prefixstr, len(infilenames), total))
     if (opt.auto and (total < 1024 and len(infilenames) < 3)) \
        or ((opt.auto or opt.force) and len(infilenames) < 2) \
        or (opt.force and not total):