summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2005-08-18 04:12:54 +0000
committerbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2005-08-18 04:12:54 +0000
commit8d6d2f2f942222bc536743f9edc6e3e7198d593f (patch)
tree42c49342413137df7f2a8a048d8da0cb5f37e9e8
parent1b992fb662acb7e68e9a25526c73178446b2d291 (diff)
downloadrdiff-backup-8d6d2f2f942222bc536743f9edc6e3e7198d593f.tar.gz
Updated signature blocksize to square root (I thought I did this already but apparently not)
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@621 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r--rdiff-backup/CHANGELOG2
-rw-r--r--rdiff-backup/rdiff_backup/Rdiff.py6
2 files changed, 5 insertions, 3 deletions
diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG
index 4684f54..ef47ca5 100644
--- a/rdiff-backup/CHANGELOG
+++ b/rdiff-backup/CHANGELOG
@@ -7,6 +7,8 @@ mirror_metadata file could become un-synced when a file is deleted
when rdiff-backup is running and later the directory that file is in
gets deleted.)
+Librsync signature blocksize now based on square root of file length.
+
New in v1.0.0 (2005/08/14)
--------------------------
diff --git a/rdiff-backup/rdiff_backup/Rdiff.py b/rdiff-backup/rdiff_backup/Rdiff.py
index 9ad6afd..5428e19 100644
--- a/rdiff-backup/rdiff_backup/Rdiff.py
+++ b/rdiff-backup/rdiff_backup/Rdiff.py
@@ -38,9 +38,9 @@ def find_blocksize(file_len):
patching can take a really long time.
"""
- if file_len < 1024000: return 512 # set minimum of 512 bytes
- else: # Split file into about 2000 pieces, rounding to 512
- return long((file_len/(2000*512))*512)
+ if file_len < 4096: return 64 # set minimum of 64 bytes
+ else: # Use square root, rounding to nearest 16
+ return long(pow(file_len, 0.5)/16)*16
def get_delta_sigfileobj(sig_fileobj, rp_new):
"""Like get_delta but signature is in a file object"""