dirstate: add a test showing a symlink problem

Summary:
Files with one of its directory being a symlink should be considered as
outside the repo. The test demonstrates that with fsmonitor, all dirstate
implementations have problems showing auditfail [1] files.

[1]: https://www.mercurial-scm.org/repo/hg/rev/2cbd27f4f3c4

Reviewed By: DurhamG

Differential Revision: D8721021

fbshipit-source-id: fcb9808b637993c4d0c173d771fd7220afb52d83
This commit is contained in:
Jun Wu 2018-07-03 05:35:41 -07:00 committed by Facebook Github Bot
parent cd0765f073
commit a397871bd0

View File

@ -0,0 +1,49 @@
#require symlink
#testcases v0 v1 v2
#if v0
$ setconfig format.dirstate=0
#endif
#if v1
$ setconfig format.dirstate=1
#endif
#if v2
$ setconfig format.dirstate=2
#endif
$ newrepo
$ mkdir a b
$ touch a/x
$ hg ci -m init -A a/x
Replace the directory with a symlink
$ mv a/x b/x
$ rmdir a
$ ln -s b a
"! a/x" should be shown, as it is implicitly removed
$ hg status
! a/x
? a
? b/x
$ hg ci -m rename -A .
adding a
removing a/x
adding b/x
#if fsmonitor
BUG: fsmonitor "hg status" shows a/x
$ hg status
? a/x
#else
$ hg status
#endif