# HG changeset patch # User Mads Kiilerich <mad...@unity3d.com> # Date 1475881182 -7200 # Sat Oct 08 00:59:42 2016 +0200 # Node ID 8838011d6452cbe31608482cc9f1b81e00fb1ca5 # Parent 5d63b84517ab6ecff8695aff0748bef9695c241c largefiles: always use filechunkitersize when using filechunkiter
(Alternatively, we could change the filechunkiter default, use the existing default, or have a custom largefiles filechunkiter wrapper ...) diff --git a/hgext/largefiles/lfutil.py b/hgext/largefiles/lfutil.py --- a/hgext/largefiles/lfutil.py +++ b/hgext/largefiles/lfutil.py @@ -57,7 +57,7 @@ def link(src, dest): # if hardlinks fail, fallback on atomic copy with open(src, 'rb') as srcf: with util.atomictempfile(dest) as dstf: - for chunk in util.filechunkiter(srcf): + for chunk in util.filechunkiter(srcf, filechunkitersize): dstf.write(chunk) os.chmod(dest, os.stat(src).st_mode) @@ -268,7 +268,7 @@ def copytostoreabsolute(repo, file, hash with open(file, 'rb') as srcf: with util.atomictempfile(storepath(repo, hash), createmode=repo.store.createmode) as dstf: - for chunk in util.filechunkiter(srcf): + for chunk in util.filechunkiter(srcf, filechunkitersize): dstf.write(chunk) linktousercache(repo, hash) @@ -399,7 +399,7 @@ def hexsha1(data): """hexsha1 returns the hex-encoded sha1 sum of the data in the file-like object data""" h = hashlib.sha1() - for chunk in util.filechunkiter(data): + for chunk in util.filechunkiter(data, filechunkitersize): h.update(chunk) return h.hexdigest() _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel