# HG changeset patch # User Pierre-Yves David # Date 1738789085 -3600 # Node ID c92f9edd362aefdd4149a1f371a444cb1ac3c5ee # Parent f1ac5117459bb5e1165b74a1feb4d2aa23a2fb32 util: expose the default chunk size for filechunkiter This will help us to decide when to use it or not in the next changeset. diff -r f1ac5117459b -r c92f9edd362a mercurial/util.py --- a/mercurial/util.py Mon Feb 03 23:28:09 2025 +0100 +++ b/mercurial/util.py Wed Feb 05 21:58:05 2025 +0100 @@ -2881,7 +2881,10 @@ return d -def filechunkiter(f, size=131072, limit=None): +DEFAULT_FILE_CHUNK = 128 * (2**10) + + +def filechunkiter(f, size=DEFAULT_FILE_CHUNK, limit=None): """Create a generator that produces the data in the file size (default 131072) bytes at a time, up to optional limit (default is to read all data). Chunks may be less than size bytes if the