mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
localrepo: remove unneeded os.unlink call in wwrite
The opener already unlinks the filename before 'w'riting, for both the symlink and the normal file case. It also now resets the flags for normal files on 'w'rite, which makes this os.unlink call completely redundant. For Windows, removing this extra unlink call helps to avoid tripping issue2524 (os.unlink followed by a write).
This commit is contained in:
parent
15eb1de134
commit
36da7599cc
@ -629,10 +629,6 @@ class localrepository(repo.repository):
|
||||
|
||||
def wwrite(self, filename, data, flags):
|
||||
data = self._filter(self._decodefilterpats, filename, data)
|
||||
try:
|
||||
os.unlink(self.wjoin(filename))
|
||||
except OSError:
|
||||
pass
|
||||
if 'l' in flags:
|
||||
self.wopener.symlink(data, filename)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user