[PATCH] Calculate file sha1 in block

Harri Salokorpi hsalokor at ee.oulu.fi
Sat Apr 16 18:32:46 BST 2005


Current sha_file() implementation reads file to memory before 
calculating the hash. Normally this is not a problem, but very large 
files can cause problems. A test case with 700MB file choked my system 
pretty badly.

I changed the implementation to read the file in blocks, which is IMHO 
the right thing to do. Might cause a slight performance hit though.

(no, I don't usually store 700MB binary blobs in SCM ;)


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 02_block_file_sha.diff
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20050416/6f509c5b/attachment.diff 

More information about the bazaar mailing list