localrepo.wwrite: use opener.symlink
authorAlexis S. L. Carvalho <alexis@cecm.usp.br>
Wed, 11 Jul 2007 17:40:41 -0300
changeset 4829 0403b80352c9
parent 4828 41ad4105dde9
child 4830 74f36b1027f4
localrepo.wwrite: use opener.symlink This makes us fall back to regular files if symlinks are not supported.
mercurial/localrepo.py
--- 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):