rust-status: fix ignore and include not composing (
issue6514)
While the fix is pretty simple, the overall dispatch logic has become kind of
ugly. Thankfully we're currently upstreaming a better algorithm, this code is
temporary anyway.
Differential Revision: https://phab.mercurial-scm.org/D10639
--- a/rust/hg-core/src/dirstate/status.rs Tue May 04 10:33:36 2021 +0200
+++ b/rust/hg-core/src/dirstate/status.rs Tue May 04 10:46:50 2021 +0200
@@ -557,9 +557,11 @@
.unwrap();
}
} else if self.is_ignored(&filename) && self.options.list_ignored {
- files_sender
- .send((filename.to_owned(), Dispatch::Ignored))
- .unwrap();
+ if self.matcher.matches(&filename) {
+ files_sender
+ .send((filename.to_owned(), Dispatch::Ignored))
+ .unwrap();
+ }
}
} else if let Some(entry) = entry_option {
// Used to be a file or a folder, now something else.
--- a/tests/test-status.t Tue May 04 10:33:36 2021 +0200
+++ b/tests/test-status.t Tue May 04 10:46:50 2021 +0200
@@ -708,4 +708,3 @@
I A.hs
I B.hs
I ignored-folder/ctest.hs
- I ignored-folder/other.txt (known-bad-output rust !)