changeset 49550:fc719967efd0 stable

dirstate-v2: fix edge case where entries aren't sorted See previous commit for more details.
author Raphaël Gomès <rgomes@octobus.net>
date Wed, 26 Oct 2022 18:46:56 +0200
parents e255a5355971
children 5f22c92dcf3d
files mercurial/dirstateutils/v2.py tests/test-dirstate.t
diffstat 2 files changed, 1 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstateutils/v2.py	Wed Oct 26 18:24:34 2022 +0200
+++ b/mercurial/dirstateutils/v2.py	Wed Oct 26 18:46:56 2022 +0200
@@ -272,7 +272,7 @@
         )
         return data, tree_metadata
 
-    sorted_map = sorted(map.items(), key=lambda x: x[0])
+    sorted_map = sorted(map.items(), key=lambda x: x[0].split(b"/"))
 
     # Use a stack to have to only remember the nodes we currently need
     # instead of building the entire tree in memory
--- a/tests/test-dirstate.t	Wed Oct 26 18:24:34 2022 +0200
+++ b/tests/test-dirstate.t	Wed Oct 26 18:46:56 2022 +0200
@@ -257,15 +257,5 @@
   $ touch src/dirstate/file1 src/dirstate/file2 src/dirstate.rs
   $ touch file1 file2
   $ hg commit -Aqm1
-#if rhg no-rust dirstate-v2
   $ hg st
-  ! src/dirstate/file1 (known-bad-output !)
-  ! src/dirstate/file2 (known-bad-output !)
-  ? src/dirstate/file1 (known-bad-output !)
-  ? src/dirstate/file2 (known-bad-output !)
-  expected a value, found none (known-bad-output !)
-  [255]
-#else
-  $ hg st
-#endif
   $ cd ..