mercurial/util.py
changeset 52098 82e2c99c84f3
parent 51934 fa7059f031a9
child 52360 fca7d38e040b
equal deleted inserted replaced
52097:720d9849dcf9 52098:82e2c99c84f3
   510         # Empty files cannot be mmapped, but mmapread should still work.  Check
   510         # Empty files cannot be mmapped, but mmapread should still work.  Check
   511         # if the file is empty, and if so, return an empty buffer.
   511         # if the file is empty, and if so, return an empty buffer.
   512         if os.fstat(fd).st_size == 0:
   512         if os.fstat(fd).st_size == 0:
   513             return b''
   513             return b''
   514         raise
   514         raise
       
   515 
       
   516 
       
   517 class uncacheable_cachestat:
       
   518     stat: Optional[os.stat_result]
       
   519 
       
   520     def __init__(self) -> None:
       
   521         self.stat = None
       
   522 
       
   523     def cacheable(self) -> bool:
       
   524         return False
   515 
   525 
   516 
   526 
   517 class fileobjectproxy:
   527 class fileobjectproxy:
   518     """A proxy around file objects that tells a watcher when events occur.
   528     """A proxy around file objects that tells a watcher when events occur.
   519 
   529