##// END OF EJS Templates
manifestcache: abstract the filename in a class attribute...
marmoute -
r42128:07c80298 default
parent child Browse files
Show More
@@ -1276,6 +1276,9 b' class manifestfulltextcache(util.lrucach'
1276 These are written in reverse cache order (oldest to newest).
1276 These are written in reverse cache order (oldest to newest).
1277
1277
1278 """
1278 """
1279
1280 _file = 'manifestfulltextcache'
1281
1279 def __init__(self, max):
1282 def __init__(self, max):
1280 super(manifestfulltextcache, self).__init__(max)
1283 super(manifestfulltextcache, self).__init__(max)
1281 self._dirty = False
1284 self._dirty = False
@@ -1287,7 +1290,7 b' class manifestfulltextcache(util.lrucach'
1287 return
1290 return
1288
1291
1289 try:
1292 try:
1290 with self._opener('manifestfulltextcache') as fp:
1293 with self._opener(self._file) as fp:
1291 set = super(manifestfulltextcache, self).__setitem__
1294 set = super(manifestfulltextcache, self).__setitem__
1292 # ignore trailing data, this is a cache, corruption is skipped
1295 # ignore trailing data, this is a cache, corruption is skipped
1293 while True:
1296 while True:
@@ -1313,8 +1316,7 b' class manifestfulltextcache(util.lrucach'
1313 if not self._dirty or self._opener is None:
1316 if not self._dirty or self._opener is None:
1314 return
1317 return
1315 # rotate backwards to the first used node
1318 # rotate backwards to the first used node
1316 with self._opener(
1319 with self._opener(self._file, 'w', atomictemp=True, checkambig=True
1317 'manifestfulltextcache', 'w', atomictemp=True, checkambig=True
1318 ) as fp:
1320 ) as fp:
1319 node = self._head.prev
1321 node = self._head.prev
1320 while True:
1322 while True:
General Comments 0
You need to be logged in to leave comments. Login now