##// END OF EJS Templates
localrepo: make invalidate avoid invalidating store inside transaction (API)...
FUJIWARA Katsunori -
r29918:d9c49138 default
parent child Browse files
Show More
@@ -1246,6 +1246,13 b' class localrepository(object):'
1246 delattr(self.unfiltered(), 'dirstate')
1246 delattr(self.unfiltered(), 'dirstate')
1247
1247
1248 def invalidate(self, clearfilecache=False):
1248 def invalidate(self, clearfilecache=False):
1249 '''Invalidates both store and non-store parts other than dirstate
1250
1251 If a transaction is running, invalidation of store is omitted,
1252 because discarding in-memory changes might cause inconsistency
1253 (e.g. incomplete fncache causes unintentional failure, but
1254 redundant one doesn't).
1255 '''
1249 unfiltered = self.unfiltered() # all file caches are stored unfiltered
1256 unfiltered = self.unfiltered() # all file caches are stored unfiltered
1250 for k in self._filecache.keys():
1257 for k in self._filecache.keys():
1251 # dirstate is invalidated separately in invalidatedirstate()
1258 # dirstate is invalidated separately in invalidatedirstate()
@@ -1259,7 +1266,11 b' class localrepository(object):'
1259 except AttributeError:
1266 except AttributeError:
1260 pass
1267 pass
1261 self.invalidatecaches()
1268 self.invalidatecaches()
1262 self.store.invalidatecaches()
1269 if not self.currenttransaction():
1270 # TODO: Changing contents of store outside transaction
1271 # causes inconsistency. We should make in-memory store
1272 # changes detectable, and abort if changed.
1273 self.store.invalidatecaches()
1263
1274
1264 def invalidateall(self):
1275 def invalidateall(self):
1265 '''Fully invalidates both store and non-store parts, causing the
1276 '''Fully invalidates both store and non-store parts, causing the
General Comments 0
You need to be logged in to leave comments. Login now