]> arthur.barton.de Git - bup.git/blobdiff - cmd/split-cmd.py
cmd/{split,save}: support any compression level using the new -# feature.
[bup.git] / cmd / split-cmd.py
index b243c61400e918fdae1b19a907177c38a61ea2a1..438fe40aaa73599938742d14fb77d77d1d522406 100755 (executable)
@@ -26,6 +26,7 @@ max-pack-size=  maximum bytes in a single pack
 max-pack-objects=  maximum number of objects in a single pack
 fanout=    maximum number of blobs in a single tree
 bwlimit=   maximum bytes/sec to transmit to server
+#,compress=  set compression level to # (0-9, 9 is highest) [1]
 """
 o = options.Options(optspec)
 (opt, flags, extra) = o.parse(sys.argv[1:])
@@ -61,7 +62,6 @@ if opt.date:
 else:
     date = time.time()
 
-
 total_bytes = 0
 def prog(filenum, nbytes):
     global total_bytes
@@ -84,13 +84,13 @@ refname = opt.name and 'refs/heads/%s' % opt.name or None
 if opt.noop or opt.copy:
     cli = pack_writer = oldref = None
 elif opt.remote or is_reverse:
-    cli = client.Client(opt.remote)
+    cli = client.Client(opt.remote, compression_level=opt.compress)
     oldref = refname and cli.read_ref(refname) or None
     pack_writer = cli.new_packwriter()
 else:
     cli = None
     oldref = refname and git.read_ref(refname) or None
-    pack_writer = git.PackWriter()
+    pack_writer = git.PackWriter(compression_level=opt.compress)
 
 if opt.git_ids:
     # the input is actually a series of git object ids that we should retrieve