mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 17:58:27 +03:00
163704f80a
Summary: In some cases we are mounting ntfs in a linux host using ntfs.3g and we want to prevent it from writing symlinks that can't be read from Windows. Some background, ntfs.3g supports symlinks, but it produces IntxLNK which cause problems when mounted into a real Windows machine. We don't support symlinks on Windows anyway, so we want to just disable this. Unfortunately it's difficult to detect if we're on a ntfs.3g fuse mount, so instead we're just going to have the machine set up the repo with this extension enabled. Differential Revision: D13964546 fbshipit-source-id: 7545538e51be4c986a50161165d7cc2e64280555
36 lines
955 B
Perl
36 lines
955 B
Perl
$ . "$TESTDIR/library.sh"
|
|
|
|
$ hg init test
|
|
$ cd test
|
|
$ echo foo > file
|
|
$ hg commit -Aqm "Add file"
|
|
|
|
Adding a symlink without the extension works
|
|
$ ln -s file link
|
|
$ ls -l | grep file
|
|
* file (glob)
|
|
* link -> file (glob)
|
|
$ hg add link
|
|
$ hg commit -m "Add link"
|
|
|
|
Adding a symlink with the extension works also
|
|
$ ln -s file link2
|
|
$ hg --config extensions.disablesymlinks= add link2
|
|
$ hg --config extensions.disablesymlinks= commit -m "Add link2"
|
|
$ ls -l | grep file
|
|
* file (glob)
|
|
* link -> file (glob)
|
|
* link2 -> file (glob)
|
|
|
|
Checking out a commit with the extension does not produce a symlink
|
|
$ hg checkout null
|
|
0 files updated, 0 files merged, 3 files removed, 0 files unresolved
|
|
$ hg checkout tip --config extensions.disablesymlinks=
|
|
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
$ ls -l | egrep '(file|link)'
|
|
* file (glob)
|
|
* link (glob)
|
|
* link2 (glob)
|
|
$ cat link
|
|
file (no-eol)
|