dirstate: fix the bug in [status] dealing with committed&ignored directories stable
authorArseniy Alekseyev <aalekseyev@janestreet.com>
Tue, 14 Mar 2023 14:08:38 +0000
branchstable
changeset 50329 edcc35a4f1dc
parent 50328 97a6d6bdbc08
child 50330 9fc0d244a753
dirstate: fix the bug in [status] dealing with committed&ignored directories In particular, these directories can "infect" their sibling directories with ignored status due to using a shared memoization cell by accident. This fixes bug #6795.
rust/hg-core/src/dirstate_tree/status.rs
tests/test-status-committed-and-ignored.t
--- a/rust/hg-core/src/dirstate_tree/status.rs	Tue Mar 14 14:01:47 2023 +0000
+++ b/rust/hg-core/src/dirstate_tree/status.rs	Tue Mar 14 14:08:38 2023 +0000
@@ -244,7 +244,7 @@
         match self.parent {
             None => false,
             Some(parent) => {
-                *(parent.cache.get_or_init(|| {
+                *(self.cache.get_or_init(|| {
                     parent.force(ignore_fn) || ignore_fn(self.path)
                 }))
             }
--- a/tests/test-status-committed-and-ignored.t	Tue Mar 14 14:01:47 2023 +0000
+++ b/tests/test-status-committed-and-ignored.t	Tue Mar 14 14:08:38 2023 +0000
@@ -30,6 +30,4 @@
   $ touch d1/g
   $ touch d2/g
   $ RAYON_NUM_THREADS=1 hg status
-  ? d2/g (no-rust no-rhg !)
-
-^ BUG: d2/g does not show up with rust status
+  ? d2/g