Mercurial > hg-stable
diff rust/hg-core/src/dirstate/status.rs @ 44896:dc60ba32d43b
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
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Tue, 12 May 2020 12:41:28 +0200 |
parents | a467416c493c |
children | c802ec4f7196 |
line wrap: on
line diff
--- 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