mercurial/revlog.py
branchstable
changeset 51650 d6c895e4adc4
parent 51635 1721d983dd6d
child 51673 df6ce326936f
equal deleted inserted replaced
51649:ba205f944cb4 51650:d6c895e4adc4
  1458         If the file is missing return the empty string"""
  1458         If the file is missing return the empty string"""
  1459         try:
  1459         try:
  1460             with self.opener(filepath) as fp:
  1460             with self.opener(filepath) as fp:
  1461                 if mmap_threshold is not None:
  1461                 if mmap_threshold is not None:
  1462                     file_size = self.opener.fstat(fp).st_size
  1462                     file_size = self.opener.fstat(fp).st_size
  1463                     if file_size >= mmap_threshold:
  1463                     if (
       
  1464                         file_size >= mmap_threshold
       
  1465                         and self.opener.is_mmap_safe(filepath)
       
  1466                     ):
  1464                         if size is not None:
  1467                         if size is not None:
  1465                             # avoid potentiel mmap crash
  1468                             # avoid potentiel mmap crash
  1466                             size = min(file_size, size)
  1469                             size = min(file_size, size)
  1467                         # TODO: should .close() to release resources without
  1470                         # TODO: should .close() to release resources without
  1468                         # relying on Python GC
  1471                         # relying on Python GC