changeset 47317:c8f62920f07a stable

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
author Raphaël Gomès <rgomes@octobus.net>
date Tue, 04 May 2021 10:46:50 +0200
parents c365850b6114
children 5ac0f2a8ba72
files rust/hg-core/src/dirstate/status.rs tests/test-status.t
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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 !)