changeset 49423:7e5377bdb66e stable

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`.
author Raphaël Gomès <rgomes@octobus.net>
date Wed, 17 Aug 2022 12:00:06 +0200
parents 55f8f3b6787f
children ef40864bc074
files rust/hg-core/src/dirstate_tree/status.rs tests/test-purge-ignored-directory.t
diffstat 2 files changed, 7 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-core/src/dirstate_tree/status.rs	Fri Aug 05 14:18:13 2022 +0100
+++ b/rust/hg-core/src/dirstate_tree/status.rs	Wed Aug 17 12:00:06 2022 +0200
@@ -728,9 +728,9 @@
                         );
                     })
                 }
-            }
-            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 {
--- a/tests/test-purge-ignored-directory.t	Fri Aug 05 14:18:13 2022 +0100
+++ b/tests/test-purge-ignored-directory.t	Wed Aug 17 12:00:06 2022 +0200
@@ -5,9 +5,8 @@
   $ 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