diff tests/test-status.t @ 47352:9d58e54b5966

dirstate-v2: Drop parent directory cache when removing a dirstate node The premise of the directory cache is that the dirstate contains child nodes for every entry that `read_dir` would return. When removing nodes, that may not be the case anymore so the cache should be invalidated. Differential Revision: https://phab.mercurial-scm.org/D10829
author Simon Sapin <simon.sapin@octobus.net>
date Tue, 01 Jun 2021 16:55:59 +0200
parents 3b9914b28133
children 284a20269a97
line wrap: on
line diff
--- a/tests/test-status.t	Mon May 31 19:54:41 2021 +0200
+++ b/tests/test-status.t	Tue Jun 01 16:55:59 2021 +0200
@@ -957,4 +957,18 @@
   $ hg status
   ? subdir/unknown
 
+  $ rm subdir/unknown
+  $ hg status
+
+Removing a node from the dirstate resets the cache for its parent directory
+
+  $ hg forget subdir/a
+  $ hg debugdirstate --dirs --no-dates | grep '^d'
+  d   0          0 set                 subdir
+  $ hg ci -qm '#1'
+  $ hg debugdirstate --dirs --no-dates | grep '^d'
+  d   0          0 unset               subdir
+  $ hg status
+  ? subdir/a
+
 #endif