comparison hgext/largefiles/reposetup.py @ 30233:3afde791dce1 stable

largefiles: handle that a found standin file doesn't exist when removing it I somehow ended up in a situation where hg crashed on an unlink I introduced in 328545c7d8a1. I don't know how it happened and can't reproduce it. It seems like it only can happen when the file is removed between the time of check in a working directory context walk that finds a standin file, and the time of use when we try to remove it because the corresponding largefile doesn't exist. But better safe than sorry: replace the plain unlink with unlinkpath with ignoremissing=True. That will also remove remaining empty directories, which arguably is more correct.
author Mads Kiilerich <madski@unity3d.com>
date Thu, 27 Oct 2016 20:06:33 +0200
parents 328545c7d8a1
children 86dfd31c0329
comparison
equal deleted inserted replaced
30232:362740e05460 30233:3afde791dce1
215 deleted.append(lfile) 215 deleted.append(lfile)
216 # Sync "largefile has been removed" back to the 216 # Sync "largefile has been removed" back to the
217 # standin. Removing a file as a side effect of 217 # standin. Removing a file as a side effect of
218 # running status is gross, but the alternatives (if 218 # running status is gross, but the alternatives (if
219 # any) are worse. 219 # any) are worse.
220 self.wvfs.unlink(standin) 220 self.wvfs.unlinkpath(standin, ignoremissing=True)
221 221
222 # Filter result lists 222 # Filter result lists
223 result = list(result) 223 result = list(result)
224 224
225 # Largefiles are not really removed when they're 225 # Largefiles are not really removed when they're