Comments
Patch
@@ -30,6 +30,7 @@ from mercurial import (
shortname = '.hglf'
shortnameslash = shortname + '/'
longname = 'largefiles'
+filechunkitersize = 128 * 1024
# -- Private worker functions ------------------------------------------
@@ -371,7 +372,7 @@ def hashfile(file):
return ''
hasher = hashlib.sha1('')
with open(file, 'rb') as fd:
- for data in util.filechunkiter(fd, 128 * 1024):
+ for data in util.filechunkiter(fd, filechunkitersize):
hasher.update(data)
return hasher.hexdigest()
@@ -1356,7 +1356,8 @@ def overridecat(orig, ui, repo, file1, *
'downloaded') % lf)
path = lfutil.usercachepath(repo.ui, hash)
with open(path, "rb") as fpin:
- for chunk in util.filechunkiter(fpin, 128 * 1024):
+ for chunk in util.filechunkiter(fpin,
+ lfutil.filechunkitersize):
fp.write(chunk)
err = 0
return err
@@ -134,7 +134,8 @@ def wirereposetup(ui, repo):
length))
# SSH streams will block if reading more than length
- for chunk in util.filechunkiter(stream, 128 * 1024, length):
+ for chunk in util.filechunkiter(stream, lfutil.filechunkitersize,
+ length):
yield chunk
# HTTP streams must hit the end to process the last empty
# chunk of Chunked-Encoding so the connection can be reused.