rust-status: don't dispatch unknown file when traversing if not listing unknowns
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.
Differential Revision: https://phab.mercurial-scm.org/D8517
--- a/rust/hg-core/src/dirstate/status.rs Tue May 12 10:03:51 2020 +0200
+++ b/rust/hg-core/src/dirstate/status.rs Tue May 12 12:41:28 2020 +0200
@@ -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