rust-status: fix ignore and include not composing (issue6514) stable
authorRaphaël Gomès <rgomes@octobus.net>
Tue, 04 May 2021 10:46:50 +0200
branchstable
changeset 47317 c8f62920f07a
parent 47316 c365850b6114
child 47318 5ac0f2a8ba72
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
rust/hg-core/src/dirstate/status.rs
tests/test-status.t
--- 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 !)