3 import hashsplit, git, options
7 bup split [-tcb] [-n name] [--bench] [filenames...]
9 b,blobs output a series of blob ids
10 t,tree output a tree id
11 c,commit output a commit id
12 n,name= name of backup set to update (if any)
13 bench print benchmark timings to stderr
15 o = options.Options('bup split', optspec)
16 (opt, flags, extra) = o.parse(sys.argv[1:])
18 if not (opt.blobs or opt.tree or opt.commit or opt.name):
19 log("bup split: use one or more of -b, -t, -c, -n\n")
22 start_time = time.time()
24 (shalist,tree) = hashsplit.split_to_tree(hashsplit.autofiles(extra))
26 for (mode,name,sum) in shalist:
30 if opt.commit or opt.name:
31 msg = 'Generated by command:\n%r' % sys.argv
32 ref = opt.name and ('refs/heads/%s' % opt.name) or None
33 commit = git.gen_commit_easy(ref, tree, msg)
37 secs = time.time() - start_time
39 log('\nbup: %.2fkbytes in %.2f secs = %.2f kbytes/sec\n'
40 % (ofs/1024., secs, ofs/1024./secs))