Reputation: 7694
Mercurial allows versioning symlinks in a repository. On unix they are created as symlinks on checkout while on windows symlinks are not supported.
Instead Mercurial apparently creates a "special" text-file for each symlink with its content being the target of the symlink. By modifying the content of this text file on a windows machine, one can change the target of the "symlink". (See this SO answer.)
Is it similarly possible to create a new symlink in a Mercurial repository on a Windows machine?
I imagine this would involve creating the "special text" file and then somehow telling mercurial to treat it as a symlink. Possibly with a workaround similar to this workaround for setting the executable bit.
Upvotes: 0
Views: 291
Reputation: 8730
I don't have a Mercurial installation on Windows to try this, but using hg import
(possibly hg import --no-commit
) for the following file seems to work on OS X and should work on Windows:
diff --git a/link b/link
new file mode 120000
--- /dev/null
+++ b/link
@@ -0,0 +1,1 @@
+other/file
\ No newline at end of file
Replace link
with the name of the file that's supposed to be the symlink and other/file
with the name of the file that it is to link to.
Note that the last line is important; it prevents a newline from being added to the end of the path.
Upvotes: 1