##// END OF EJS Templates
rev-branch-cache: disable mmapping by default on Windows...
Matt Harbison -
r53010:db1980a3 default
parent child Browse files
Show More
@@ -14,6 +14,7 from ..node import (
14 from .. import (
14 from .. import (
15 encoding,
15 encoding,
16 error,
16 error,
17 pycompat,
17 util,
18 util,
18 )
19 )
19
20
@@ -176,7 +177,19 class revbranchcache:
176
177
177 if self._names:
178 if self._names:
178 try:
179 try:
179 usemmap = repo.ui.configbool(b'storage', b'revbranchcache.mmap')
180 # In order to rename the atomictempfile in _writerevs(), the
181 # existing file needs to be removed. The Windows code
182 # (successfully) renames it to a temp file first, before moving
183 # the temp file into its place. But the removal of the original
184 # file then fails, because it's still mapped. The mmap object
185 # needs to be closed in order to remove the file, but in order
186 # to do that, the memoryview returned by util.buffer needs to be
187 # released.
188 usemmap = repo.ui.configbool(
189 b'storage',
190 b'revbranchcache.mmap',
191 default=not pycompat.iswindows,
192 )
180 if not v1_fallback:
193 if not v1_fallback:
181 with repo.cachevfs(_rbcrevs) as fp:
194 with repo.cachevfs(_rbcrevs) as fp:
182 if usemmap and repo.cachevfs.is_mmap_safe(_rbcrevs):
195 if usemmap and repo.cachevfs.is_mmap_safe(_rbcrevs):
@@ -2192,7 +2192,7 experimental = true # experimental as l
2192 [[items]]
2192 [[items]]
2193 section = "storage"
2193 section = "storage"
2194 name = "revbranchcache.mmap"
2194 name = "revbranchcache.mmap"
2195 default = true
2195 default-type = "dynamic"
2196
2196
2197 [[items]]
2197 [[items]]
2198 section = "storage"
2198 section = "storage"
General Comments 0
You need to be logged in to leave comments. Login now