dirstate-tree: Add a test showing that issue 6335 is fixed
authorSimon Sapin <simon.sapin@octobus.net>
Fri, 07 May 2021 16:41:07 +0200
changeset 47130 cfbbafb04037
parent 47129 93eb6c8035a9
child 47131 46c6be5f1efa
dirstate-tree: Add a test showing that issue 6335 is fixed … when using the new status algorithm and the tree-based dirstate. The previous algorithm still has this bug. Differential Revision: https://phab.mercurial-scm.org/D10699
tests/test-status.t
--- a/tests/test-status.t	Mon May 03 20:04:19 2021 +0200
+++ b/tests/test-status.t	Fri May 07 16:41:07 2021 +0200
@@ -699,3 +699,38 @@
   $ hg add a.py b.rs
   $ hg st -aI "*.py"
   A a.py
+
+issue6335
+When a directory containing a tracked file gets symlinked, as of 5.8
+`hg st` only gives the correct answer about clean (or deleted) files
+if also listing unknowns.
+The tree-based dirstate and status algorithm fix this:
+
+#if symlink no-dirstate-v1
+
+  $ cd ..
+  $ hg init issue6335
+  $ cd issue6335
+  $ mkdir foo
+  $ touch foo/a
+  $ hg ci -Ama
+  adding foo/a
+  $ mv foo bar
+  $ ln -s bar foo
+  $ hg status
+  ! foo/a
+  ? bar/a
+  ? foo
+
+  $ hg status -c  # incorrect output with `dirstate-v1`
+  $ hg status -cu
+  ? bar/a
+  ? foo
+  $ hg status -d  # incorrect output with `dirstate-v1`
+  ! foo/a
+  $ hg status -du
+  ! foo/a
+  ? bar/a
+  ? foo
+
+#endif