diff rust/hg-core/src/dirstate/dirstate_map.rs @ 46227:5bae4bc9bd42

rust: fix file folding map The file folding map, frequently used on macOS, had two issues: * the means for converting it to Python didn't work * a minor typo when copying the python code, where `!=` became `==` With this, the rust code passes all tests on macOS. Test Plan: I'm currently doing a full test run on a case-insensitive file system. If it passes, perhaps we can change the platform check from an error to a warning? Differential Revision: https://phab.mercurial-scm.org/D9671
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Wed, 30 Dec 2020 00:14:28 +0100
parents 496537c9c1b4
children 776b97179c06
line wrap: on
line diff
--- a/rust/hg-core/src/dirstate/dirstate_map.rs	Tue Jan 12 22:43:55 2021 +0100
+++ b/rust/hg-core/src/dirstate/dirstate_map.rs	Wed Dec 30 00:14:28 2020 +0100
@@ -431,7 +431,7 @@
         let mut new_file_fold_map = FileFoldMap::default();
 
         for (filename, DirstateEntry { state, .. }) in self.state_map.iter() {
-            if *state == EntryState::Removed {
+            if *state != EntryState::Removed {
                 new_file_fold_map
                     .insert(normalize_case(&filename), filename.to_owned());
             }
@@ -447,7 +447,7 @@
         let mut new_file_fold_map = FileFoldMap::default();
 
         for (filename, DirstateEntry { state, .. }) in self.state_map.iter() {
-            if state == EntryState::Removed {
+            if state != EntryState::Removed {
                 new_file_fold_map
                     .insert(normalize_case(&filename), filename.to_owned());
             }