Reputation: 289
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?
Upvotes: 3
Views: 819
Reputation: 73788
I'm afraid there is no work-around on Windows. You could write an extension that would let you set the symlink bit for a file on Windows, though. This extension will probably have to override dirstate.flagfunc
, which is the function used when asking for the "flags" (execute and symlink bit) for a file.
See also Issue 1825 for the overall feature of making Mercurial create Windows symlinks in a checkout. It's marked "done, could-be-better" so it's unlikely to change any time soon.
Upvotes: 1