Can Mercurial create its own symbolic link format from Windows?

I know that Mercurial does not support symbolic links in repositories on Windows; I can live with that, although an implementation using NTFS symlinks would be nice for those who can enable privilege in their windows windows for non-admins.

I am wondering how Mercurial handles the actual links from the Unix repository when the repo is displayed on a Windows machine. If I update from a symlink repo on my windows dev machine, I see that the link is changed to the actual file with the intent to link in it as text.

Somehow Mercurial knows, even on Windows, that the file was originally a symbolic link, even when stored as a real file. If I edit the contents of the file on Windows, I can change the target of the symlink, because it is still written as a Mercurial symlink - when I return to Unix, the symlink points to the new location.

So. How do I mark a file I created on Windows as a symbolic link? It's clear that Mercurial can use such a symbolic link on a 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?

+3


source to share


1 answer


I'm afraid it doesn't work on Windows . You could write an extension that would allow you to set the symlink bit for a file on Windows. This extension will probably need to override dirstate.flagfunc

, which is the function used when requesting the "flags" (execute bit and symlink) for a file.



See also Issue 1825 for a generic Mercurial build function for creating Windows symbolic links at checkout. He noted that "it has been done, it could be better", so it is unlikely that it will change in the near future.

+1


source







All Articles