# HG changeset patch # User Arseniy Alekseyev # Date 2023-03-14 14:08:38 # Node ID edcc35a4f1dc7f982dd5aef172aa0bcaa9e9ec94 # Parent 97a6d6bdbc08df0d7b2f8c8528a21d5ba3daff9b 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. diff --git a/rust/hg-core/src/dirstate_tree/status.rs b/rust/hg-core/src/dirstate_tree/status.rs --- a/rust/hg-core/src/dirstate_tree/status.rs +++ b/rust/hg-core/src/dirstate_tree/status.rs @@ -244,7 +244,7 @@ impl<'a> HasIgnoredAncestor<'a> { 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) })) } diff --git a/tests/test-status-committed-and-ignored.t b/tests/test-status-committed-and-ignored.t --- a/tests/test-status-committed-and-ignored.t +++ b/tests/test-status-committed-and-ignored.t @@ -30,6 +30,4 @@ Untracked files in d2 are still shown, b $ 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