localrepo.wwrite: use opener.symlink
This makes us fall back to regular files if symlinks are not supported.
--- a/mercurial/localrepo.py Wed Jul 11 17:40:41 2007 -0300
+++ b/mercurial/localrepo.py Wed Jul 11 17:40:41 2007 -0300
@@ -455,15 +455,7 @@
def wwrite(self, filename, data, flags):
data = self._filter("decode", filename, data)
if "l" in flags:
- f = self.wjoin(filename)
- try:
- os.unlink(f)
- except OSError:
- pass
- d = os.path.dirname(f)
- if not os.path.exists(d):
- os.makedirs(d)
- os.symlink(data, f)
+ self.wopener.symlink(data, filename)
else:
try:
if self._link(filename):