D7233: hghave: disallow symlinks on Windows

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Tue Nov 5 22:47:35 EST 2019


This revision is now accepted and ready to land.
indygreg added a comment.
indygreg accepted this revision.


  In D7233#106273 <https://phab.mercurial-scm.org/D7233#106273>, @mharbison72 wrote:
  
  > In D7233#106184 <https://phab.mercurial-scm.org/D7233#106184>, @indygreg wrote:
  >
  >> Shouldn't we be making this change in the core product as well? Otherwise Mercurial may attempt to use symlinks on Windows and we could blow up due to not having any test coverage?
  >
  > This should be what's disabling it in core, via `util.checklink()`:
  > https://www.mercurial-scm.org/repo/hg/file/5.2/mercurial/windows.py#l276
  
  Ahh, cool.
  
  > Just for fun, I enabled that and ran the tests in an admin window.  What I learned is that `ln -s` doesn't make symlinks, so I had to substitute a `os.symlink()` snippet, but there are more than a couple of these.  I figure when we want to enable it, we can patch in a shell alias in MSYS like is done for `pwd`[1], and point it to a *.py implementation.  And then I hit a test where a symlink without a target is `tar`d and then extracted... and MSYS `tar` didn't like that.  I set it aside at that point, but there may be other issues.
  > [1] https://www.mercurial-scm.org/repo/hg/file/5.2/tests/run-tests.py#l1726
  
  I think symlinks on Windows are too fragile to even consider enabling. So I'm fine leaving them disabled on Windows indefinitely.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7233/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7233

To: mharbison72, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel


More information about the Mercurial-devel mailing list