3

I know that Mercurial doesn't support symbolic links in repos on Windows; I can live with that, though an implementation using NTFS symlinks would be nice for those who can enable the privilege on their Windows boxes for non-admins.

What I'm wondering is about the way that Mercurial treats actual links from a Unix repository when the repo is seen on a Windows machine. If I update from a repo with a symlink in on my Windows development machine, I see that the link is changed into an actual file with the target of the link in it as text.

Somehow, Mercurial knows even on Windows that the file was originally a symlink, even when it is stored as a real file. If I edit the contents of the file in Windows, I can change the target of the symlink, because it's still recorded as being a symlink by Mercurial - when I push back to Unix, the symlink is pointing to the new location.

So. How do I mark a file that I've created in Windows as a symlink? It's clear that Mercurial could push such a symlink into the Unix filesystem, but I don't know how to mark it as such without creating the link first under Unix.

Is there a flag that can be set?

4

1 回答 1

1

恐怕在 Windows 上没有解决方法。不过,您可以编写一个扩展程序,让您在 Windows 上为文件设置符号链接位。此扩展可能必须覆盖dirstate.flagfunc,这是在请求文件的“标志”(执行和符号链接位)时使用的函数。

有关使 Mercurial 在结帐时创建 Windows 符号链接的整体功能,另请参阅Issue 1825。它被标记为“完成,可能会更好”,因此它不太可能很快改变。

于 2012-04-12T16:14:10.837 回答