--- a/mercurial/localrepo.py Fri Jan 05 21:28:49 2007 +0200
+++ b/mercurial/localrepo.py Fri Feb 23 17:54:34 2007 +0200
@@ -525,11 +525,15 @@
def wwrite(self, filename, data, flags):
data = self._filter("decode", filename, data)
if "l" in flags:
+ f = self.wjoin(filename)
try:
- os.unlink(self.wjoin(filename))
+ os.unlink(f)
except OSError:
pass
- os.symlink(data, self.wjoin(filename))
+ d = os.path.dirname(f)
+ if not os.path.exists(d):
+ os.makedirs(d)
+ os.symlink(data, f)
else:
try:
if self._link(filename):