Patchwork D10639: rust-status: fix ignore and include not composing (issue6514)

login
register
mail settings
Submitter phabricator
Date May 4, 2021, 8:48 a.m.
Message ID <differential-rev-PHID-DREV-ph26w224636rau3em5kv-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48958/
State Superseded
Headers show

Comments

phabricator - May 4, 2021, 8:48 a.m.
Alphare created this revision.
Alphare added a comment.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.


  Pending CI refresh

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D10639

AFFECTED FILES
  rust/hg-core/src/dirstate/status.rs
  tests/test-status.t

CHANGE DETAILS




To: Alphare, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-status.t b/tests/test-status.t
--- a/tests/test-status.t
+++ b/tests/test-status.t
@@ -708,4 +708,3 @@ 
   I A.hs
   I B.hs
   I ignored-folder/ctest.hs
-  I ignored-folder/other.txt (known-bad-output rust !)
diff --git a/rust/hg-core/src/dirstate/status.rs b/rust/hg-core/src/dirstate/status.rs
--- a/rust/hg-core/src/dirstate/status.rs
+++ b/rust/hg-core/src/dirstate/status.rs
@@ -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.