changeset 13113:a98a90023261

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).
author Adrian Buehlmann <adrian@cadifra.com>
date Fri, 10 Dec 2010 16:10:14 +0100
parents 039a964dbbb3
children 8f29a08e7bbc
files mercurial/localrepo.py
diffstat 1 files changed, 0 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Fri Dec 10 15:14:05 2010 +0100
+++ b/mercurial/localrepo.py	Fri Dec 10 16:10:14 2010 +0100
@@ -629,10 +629,6 @@
 
     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: