diff -r 1d38f3605b20 -r 202d178ec706 mercurial/util.py --- 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):