Mercurial > hg-stable
changeset 20957:469d949a7cb8 stable
revlog: deal with chunk ranges over 2G on Windows (issue4215)
Python uses a C long (32 bits on Windows 64) rather than an ssize_t in
read(), and thus has a 2G size limit. Work around this by falling back
to reading one chunk at a time on overflow. This approximately doubles
our headroom until we run back into the size limit on single reads.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 07 Apr 2014 14:18:10 -0500 |
parents | e9725e18bdf8 |
children | 774ff56cbe34 a0f437e2f5a9 |
files | mercurial/revlog.py |
diffstat | 1 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/revlog.py Thu Apr 03 20:35:56 2014 -0500 +++ b/mercurial/revlog.py Mon Apr 07 14:18:10 2014 -0500 @@ -909,8 +909,13 @@ ladd = l.append # preload the cache - self._chunkraw(revs[0], revs[-1]) - offset, data = self._chunkcache + try: + self._chunkraw(revs[0], revs[-1]) + offset, data = self._chunkcache + except OverflowError: + # issue4215 - we can't cache a run of chunks greater than + # 2G on Windows + return [self._chunk(rev) for rev in revs] for rev in revs: chunkstart = start(rev)