# HG changeset patch # User Raphaël Gomès # Date 2022-08-17 10:00:06 # Node ID 7e5377bdb66eddb487b763a97f2a51a682862e57 # Parent 55f8f3b6787f312ae30f68e5d7de46e1ffca1177 rust-status: ignored directories are now correctly only listed if opted into This fixes the behavior of `hg purge` removing empty ignored directory even without `--all` or `--ignored`. diff --git a/rust/hg-core/src/dirstate_tree/status.rs b/rust/hg-core/src/dirstate_tree/status.rs --- a/rust/hg-core/src/dirstate_tree/status.rs +++ b/rust/hg-core/src/dirstate_tree/status.rs @@ -728,9 +728,9 @@ impl<'a, 'tree, 'on_disk> StatusCommon<' ); }) } - } - if self.options.collect_traversed_dirs { - self.outcome.lock().unwrap().traversed.push(hg_path.into()) + if self.options.collect_traversed_dirs { + self.outcome.lock().unwrap().traversed.push(hg_path.into()) + } } is_ignored } else { diff --git a/tests/test-purge-ignored-directory.t b/tests/test-purge-ignored-directory.t --- a/tests/test-purge-ignored-directory.t +++ b/tests/test-purge-ignored-directory.t @@ -5,9 +5,8 @@ skip ignored directories if -i or --all $ echo 'ignored' > .hgignore $ hg ci -qA -m init -d'2 0' $ mkdir ignored - -The better behavior here is the non-rust behavior, which is to keep -the directory and only delete it when -i or --all is given. - + $ ls + ignored $ hg purge -v --no-confirm - removing directory ignored (known-bad-output rust !) + $ ls + ignored