branch | stable |
changeset 51653 | d6c895e4adc4 |
parent 51638 | 1721d983dd6d |
child 51677 | df6ce326936f |
--- a/mercurial/revlog.py Wed Jul 03 12:22:48 2024 +0200 +++ b/mercurial/revlog.py Wed Jul 03 12:26:57 2024 +0200 @@ -1460,7 +1460,10 @@ with self.opener(filepath) as fp: if mmap_threshold is not None: file_size = self.opener.fstat(fp).st_size - if file_size >= mmap_threshold: + if ( + file_size >= mmap_threshold + and self.opener.is_mmap_safe(filepath) + ): if size is not None: # avoid potentiel mmap crash size = min(file_size, size)