comparison mercurial/repair.py @ 20885:f49d60fa40a5

fncache: clean up fncache during strips Previously the fncache was cleaned up at read time by noticing when it was out of sync. This caused writes to happen outside the scope of transactions and could have caused race conditions. With this change, we'll keep the fncache up-to-date as we go by removing old entries during repair.strip.
author Durham Goode <durham@fb.com>
date Mon, 24 Mar 2014 15:43:15 -0700
parents 5fc2ae1c631b
children 24a443948627
comparison
equal deleted inserted replaced
20884:2efdd186925d 20885:f49d60fa40a5
132 132
133 try: 133 try:
134 for i in xrange(offset, len(tr.entries)): 134 for i in xrange(offset, len(tr.entries)):
135 file, troffset, ignore = tr.entries[i] 135 file, troffset, ignore = tr.entries[i]
136 repo.sopener(file, 'a').truncate(troffset) 136 repo.sopener(file, 'a').truncate(troffset)
137 if troffset == 0:
138 repo.store.markremoved(file)
137 tr.close() 139 tr.close()
138 except: # re-raises 140 except: # re-raises
139 tr.abort() 141 tr.abort()
140 raise 142 raise
141 143