mercurial/localrepo.py
changeset 4868 192cd95c2ba8
parent 4856 1f3742217a76
parent 4860 0403b80352c9
child 4889 d69b1fb111b9
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -460,15 +460,7 @@ class localrepository(repo.repository):
     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):