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:])
git.verbose = opt.verbose - 1
opt.bench = 1
if opt.max_pack_size:
- hashsplit.max_pack_size = parse_num(opt.max_pack_size)
+ git.max_pack_size = parse_num(opt.max_pack_size)
if opt.max_pack_objects:
- hashsplit.max_pack_objects = parse_num(opt.max_pack_objects)
+ git.max_pack_objects = parse_num(opt.max_pack_objects)
if opt.fanout:
hashsplit.fanout = parse_num(opt.fanout)
if opt.blobs:
else:
date = time.time()
-
total_bytes = 0
def prog(filenum, nbytes):
global total_bytes
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
files = extra and (open(fn) for fn in extra) or [sys.stdin]
if pack_writer and opt.blobs:
- shalist = hashsplit.split_to_blobs(pack_writer, files,
+ shalist = hashsplit.split_to_blobs(pack_writer.new_blob, files,
keep_boundaries=opt.keep_boundaries,
progress=prog)
for (sha, size, level) in shalist:
print sha.encode('hex')
reprogress()
elif pack_writer: # tree or commit or name
- shalist = hashsplit.split_to_shalist(pack_writer, files,
+ shalist = hashsplit.split_to_shalist(pack_writer.new_blob,
+ pack_writer.new_tree,
+ files,
keep_boundaries=opt.keep_boundaries,
progress=prog)
tree = pack_writer.new_tree(shalist)