comparison tests/test-hardlinks.t @ 32295:b9135f191d8a

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
author Jun Wu <quark@fb.com>
date Mon, 15 May 2017 13:29:18 -0700
parents 905a2eff08a6
children 37bcb4665529
comparison
equal deleted inserted replaced
32294:905a2eff08a6 32295:b9135f191d8a
212 212
213 Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'): 213 Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'):
214 214
215 $ linkcp r3 r4 215 $ linkcp r3 r4
216 216
217 'checklink' is produced by hardlinking a symlink, which is undefined whether
218 the symlink should be followed or not. It does behave differently on Linux and
219 BSD. Just remove it so the test pass on both platforms.
220
221 $ rm -f r4/.hg/cache/checklink
222
217 r4 has hardlinks in the working dir (not just inside .hg): 223 r4 has hardlinks in the working dir (not just inside .hg):
218 224
219 $ nlinksdir r4 225 $ nlinksdir r4
220 2 r4/.hg/00changelog.i 226 2 r4/.hg/00changelog.i
221 2 r4/.hg/branch 227 2 r4/.hg/branch
222 2 r4/.hg/cache/checkisexec (execbit !) 228 2 r4/.hg/cache/checkisexec (execbit !)
223 3 r4/.hg/cache/checklink (?)
224 ? r4/.hg/cache/checklink-target (glob) (symlink !) 229 ? r4/.hg/cache/checklink-target (glob) (symlink !)
225 2 r4/.hg/cache/checknoexec (execbit !) 230 2 r4/.hg/cache/checknoexec (execbit !)
226 2 r4/.hg/cache/branch2-base 231 2 r4/.hg/cache/branch2-base
227 2 r4/.hg/cache/branch2-served 232 2 r4/.hg/cache/branch2-served
228 2 r4/.hg/cache/checkisexec 233 2 r4/.hg/cache/checkisexec