From 0aec3f6ed9c6dcddc914e5f18dfcb74c4c2f4f96 Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Mon, 11 Jan 2010 19:11:25 -0500 Subject: [PATCH] split_to_blob_or_tree was accidentally not using the 'fanout' setting. Thus, 'bup save' on huge files would suck lots of RAM. --- cmd-split.py | 3 ++- hashsplit.py | 9 ++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd-split.py b/cmd-split.py index 5f41646..7b76b57 100755 --- a/cmd-split.py +++ b/cmd-split.py @@ -52,7 +52,8 @@ else: oldref = refname and git.read_ref(refname) or None w = git.PackWriter() -(shalist,tree) = hashsplit.split_to_tree(w, hashsplit.autofiles(extra)) +shalist = hashsplit.split_to_shalist(w, hashsplit.autofiles(extra)) +tree = w.new_tree(shalist) if opt.verbose: log('\n') diff --git a/hashsplit.py b/hashsplit.py index 6a92872..278abfc 100644 --- a/hashsplit.py +++ b/hashsplit.py @@ -104,7 +104,7 @@ def hashsplit_iter(w, files): total_split = 0 -def split_to_shalist(w, files): +def _split_to_shalist(w, files): global total_split ofs = 0 last_ofs = 0 @@ -130,8 +130,8 @@ def _next(i): return None -def split_to_tree(w, files): - sl = iter(split_to_shalist(w, files)) +def split_to_shalist(w, files): + sl = iter(_split_to_shalist(w, files)) if not fanout: shalist = list(sl) else: @@ -143,8 +143,7 @@ def split_to_tree(w, files): shalist.append(('40000', tmplist[0][1], w.new_tree(tmplist))) tmplist = [] shalist += tmplist - tree = w.new_tree(shalist) - return (shalist, tree) + return shalist def split_to_blob_or_tree(w, files): -- 2.39.5