# HG changeset patch # User Jun Wu # Date 2017-05-15 20:29:18 # Node ID b9135f191d8a2ebd56322728f53178d694244904 # Parent 905a2eff08a6afc154126f249f22dc1ddccea61a test-hardlink: do not test .hg/cache/checklink Linux and BSD have different behavior on "os.link(src, dst)" where "src" is a symlink. That causes test difference. According to POSIX [1]: If path1 names a symbolic link, it is implementation-defined whether link() follows the symbolic link, or creates a new link to the symbolic link itself. So both behaviors are correct. This patch removes the trouble maker "checklink" to make the test pass on both platforms. [1]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html diff --git a/tests/test-hardlinks.t b/tests/test-hardlinks.t --- a/tests/test-hardlinks.t +++ b/tests/test-hardlinks.t @@ -214,13 +214,18 @@ Create hardlinked copy r4 of r3 (on Linu $ linkcp r3 r4 +'checklink' is produced by hardlinking a symlink, which is undefined whether +the symlink should be followed or not. It does behave differently on Linux and +BSD. Just remove it so the test pass on both platforms. + + $ rm -f r4/.hg/cache/checklink + r4 has hardlinks in the working dir (not just inside .hg): $ nlinksdir r4 2 r4/.hg/00changelog.i 2 r4/.hg/branch 2 r4/.hg/cache/checkisexec (execbit !) - 3 r4/.hg/cache/checklink (?) ? r4/.hg/cache/checklink-target (glob) (symlink !) 2 r4/.hg/cache/checknoexec (execbit !) 2 r4/.hg/cache/branch2-base