Soft link broken with mercurial

Dr Rainer Woitok rainer.woitok at gmail.com
Fri Nov 23 15:12:42 UTC 2018


Hari,

On Wednesday, 2018-11-21 02:12:44 +0000, you wrote:

> ...
> I have a repository where I have created softlinks.
> ...
> In both scenarios after commit or after taking the patch and applying the patch in another local repository ( same content ), soft link is broken. And if file 2 content is verified, it will show as file 1.

Are you going to say  that the contents of "file 2"  is simply the ASCII
string "file 1" without a line-ending "\n" character?  It looks like you
are working under Windows/Cygwin.   Mercurial version 2.1.2 (still older
than the very outdated version  you are using)  disabled symlink support
under Cygwin due to unwanted side effects.

Sorry to say,  but updating to a more recent version will not solve THIS
problem.   What you can do, however,  is building Mercurial from source,
after patching file "posix.py" to get symlinks back  under Cygwin.   And
if you want the symbolic links created by Mercurial to be also recogniz-
ed by native Windows applications (like the "File Explorer") you'll also
have to write  a "postupdate" hook  which re-creates  all symbolic links
just created/modified  by the current  "hg update"  command via Cygwin's
"ln" command,  because Mercurial's symlinks will not be correctly recog-
nized by Windows while Cygwin's symbolic links will be.

I've done that myself  under Cygwin since ages  (well, since about 2012/
2013) without ever noticing any ill side effects.

Sincerely,
  Rainer



More information about the Mercurial mailing list