##// END OF EJS Templates
localrepo: discard objects in _filecache at transaction failure (issue4876)...
FUJIWARA Katsunori -
r26831:0a761075 stable
parent child Browse files
Show More
@@ -847,7 +847,6 b' class queue(object):'
847 try:
847 try:
848 tr.abort()
848 tr.abort()
849 finally:
849 finally:
850 repo.invalidate()
851 self.invalidate()
850 self.invalidate()
852 raise
851 raise
853 finally:
852 finally:
@@ -1014,6 +1014,8 b' class localrepository(object):'
1014 # out) in this transaction
1014 # out) in this transaction
1015 repo.vfs.rename('journal.dirstate', 'dirstate')
1015 repo.vfs.rename('journal.dirstate', 'dirstate')
1016
1016
1017 repo.invalidate(clearfilecache=True)
1018
1017 tr = transaction.transaction(rp, self.svfs, vfsmap,
1019 tr = transaction.transaction(rp, self.svfs, vfsmap,
1018 "journal",
1020 "journal",
1019 "undo",
1021 "undo",
@@ -1205,13 +1207,15 b' class localrepository(object):'
1205 pass
1207 pass
1206 delattr(self.unfiltered(), 'dirstate')
1208 delattr(self.unfiltered(), 'dirstate')
1207
1209
1208 def invalidate(self):
1210 def invalidate(self, clearfilecache=False):
1209 unfiltered = self.unfiltered() # all file caches are stored unfiltered
1211 unfiltered = self.unfiltered() # all file caches are stored unfiltered
1210 for k in self._filecache:
1212 for k in self._filecache.keys():
1211 # dirstate is invalidated separately in invalidatedirstate()
1213 # dirstate is invalidated separately in invalidatedirstate()
1212 if k == 'dirstate':
1214 if k == 'dirstate':
1213 continue
1215 continue
1214
1216
1217 if clearfilecache:
1218 del self._filecache[k]
1215 try:
1219 try:
1216 delattr(unfiltered, k)
1220 delattr(unfiltered, k)
1217 except AttributeError:
1221 except AttributeError:
General Comments 0
You need to be logged in to leave comments. Login now