runtests-cmdline: all
@echo "Testing \"$@\" in Makefile:"
./bup split --bench -b <testfile1 >tags1
- ./bup split -b testfile2 >tags2
+ ./bup split -vvvv -b testfile2 >tags2
diff -u tags1 tags2 || true
wc -c testfile1 testfile2
wc -l tags1 tags2
t,tree output a tree id
c,commit output a commit id
n,name= name of backup set to update (if any)
+v,verbose increase log output (can be used more than once)
bench print benchmark timings to stderr
"""
o = options.Options('bup split', optspec)
log("bup split: use one or more of -b, -t, -c, -n\n")
o.usage()
+hashsplit.split_verbosely = opt.verbose
+
start_time = time.time()
(shalist,tree) = hashsplit.split_to_tree(hashsplit.autofiles(extra))
BLOB_LWM = 8192*2
BLOB_MAX = BLOB_LWM*2
BLOB_HWM = 1024*1024
-
+split_verbosely = 0
class Buf:
def __init__(self):
def splitbuf(buf):
+ global split_verbosely
b = buf.peek(buf.used())
ofs = chashsplit.splitbuf(b)
if ofs:
+ if split_verbosely >= 2:
+ log('.')
buf.eat(ofs)
return buffer(b, 0, ofs)
return None
def hashsplit_iter(files):
+ global split_verbosely
ofs = 0
buf = Buf()
fi = blobiter(files)
nv = (ofs + buf.used())/1000000
if nv != lv:
- #log('%d\t' % nv)
+ if split_verbosely >= 1:
+ log('%d\t' % nv)
lv = nv