mercurial/util.py
changeset 6878 202d178ec706
parent 6877 1d38f3605b20
child 6884 11229144aa01
child 7221 b340cb536893
--- a/mercurial/util.py	Sun Aug 10 21:55:06 2008 -0500
+++ b/mercurial/util.py	Sun Aug 10 21:55:23 2008 -0500
@@ -1150,7 +1150,11 @@
                 # switch file to link
                 data = file(f).read()
                 os.unlink(f)
-                os.symlink(data, f)
+                try:
+                    os.symlink(data, f)
+                except:
+                    # failed to make a link, rewrite file
+                    file(f, "w").write(data)
             # no chmod needed at this point
             return
         if stat.S_ISLNK(s):