]> arthur.barton.de Git - bup.git/commitdiff
split_to_blob_or_tree was accidentally not using the 'fanout' setting.
authorAvery Pennarun <apenwarr@gmail.com>
Tue, 12 Jan 2010 00:11:25 +0000 (19:11 -0500)
committerAvery Pennarun <apenwarr@gmail.com>
Tue, 12 Jan 2010 01:09:57 +0000 (20:09 -0500)
Thus, 'bup save' on huge files would suck lots of RAM.

cmd-split.py
hashsplit.py

index 5f4164621f6831d22284fde0d1df4c775e0e9d7b..7b76b57339d0e61e3758f0b24aef195eb21eb8fe 100755 (executable)
@@ -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')
index 6a928726f017a64a225d0ee4bcbde6250459c6d4..278abfc05c05c5d79eb29e77f4be8814c6018d5d 100644 (file)
@@ -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):