[Request] [+ ] D8517: rust-status: don't dispatch unknown file when traversing if not listing unknowns

Alphare (Raphaël Gomès) phabricator at mercurial-scm.org
Tue May 12 11:50:54 UTC 2020


Alphare created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This usually isn't a (functional) problem since we ignore the unknown files
  anyway, but when specifically using `hg purge`, unknown files were iterated over
  regardless of the option being true.
  This is both more correct and more efficient.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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

CHANGE DETAILS

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
@@ -371,9 +371,11 @@
                         .unwrap();
                 }
             } else {
-                files_sender
-                    .send(Ok((filename.to_owned(), Dispatch::Unknown)))
-                    .unwrap();
+                if options.list_unknown {
+                    files_sender
+                        .send(Ok((filename.to_owned(), Dispatch::Unknown)))
+                        .unwrap();
+                }
             }
         } else if ignore_fn(&filename) && options.list_ignored {
             files_sender



To: Alphare, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20200512/36fbb8cc/attachment.html>


More information about the Mercurial-patches mailing list