mercurial/localrepo.py
changeset 29918 d9c49138ab93
parent 29883 0c8c388c7d62
child 29920 e35a83cedde1
equal deleted inserted replaced
29917:f32f8bf5dc4c 29918:d9c49138ab93
  1244                 except AttributeError:
  1244                 except AttributeError:
  1245                     pass
  1245                     pass
  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()
  1252             if k == 'dirstate':
  1259             if k == 'dirstate':
  1253                 continue
  1260                 continue
  1257             try:
  1264             try:
  1258                 delattr(unfiltered, k)
  1265                 delattr(unfiltered, k)
  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
  1266         subsequent operation to reread any outside changes.'''
  1277         subsequent operation to reread any outside changes.'''
  1267         # extension should hook this to invalidate its caches
  1278         # extension should hook this to invalidate its caches