1091 and (path.startswith(b'data/') or path.startswith(b'meta/')) |
1091 and (path.startswith(b'data/') or path.startswith(b'meta/')) |
1092 and is_revlog_file(path) |
1092 and is_revlog_file(path) |
1093 ): |
1093 ): |
1094 # do not trigger a fncache load when adding a file that already is |
1094 # do not trigger a fncache load when adding a file that already is |
1095 # known to exist. |
1095 # known to exist. |
1096 notload = self.fncache.entries is None and self.vfs.exists(encoded) |
1096 notload = self.fncache.entries is None and ( |
1097 if notload and b'r+' in mode and not self.vfs.stat(encoded).st_size: |
1097 # if the file has size zero, it should be considered as missing. |
1098 # when appending to an existing file, if the file has size zero, |
1098 # Such zero-size files are the result of truncation when a |
1099 # it should be considered as missing. Such zero-size files are |
1099 # transaction is aborted. |
1100 # the result of truncation when a transaction is aborted. |
1100 self.vfs.exists(encoded) |
1101 notload = False |
1101 and self.vfs.stat(encoded).st_size |
|
1102 ) |
1102 if not notload: |
1103 if not notload: |
1103 self.fncache.add(path) |
1104 self.fncache.add(path) |
1104 return self.vfs(encoded, mode, *args, **kw) |
1105 return self.vfs(encoded, mode, *args, **kw) |
1105 |
1106 |
1106 def join(self, path): |
1107 def join(self, path): |