diff rust/hg-core/src/dirstate_tree/dispatch.rs @ 48045:32ef647821b2

dirstate: Skip no-op conversion in Rust DirstateMap::set_v1 Now that the `DirstateItem` python class is implemented in Rust containing a `DirstateEntry` value, use that value directly instead of reconstructing it from v1 data. Also rename from `set_v1` since dirstate-v1 data is not used anymore. Differential Revision: https://phab.mercurial-scm.org/D11487
author Simon Sapin <simon.sapin@octobus.net>
date Wed, 22 Sep 2021 18:21:58 +0200
parents 357307feaf61
children 9b2a51b2c36a
line wrap: on
line diff
--- a/rust/hg-core/src/dirstate_tree/dispatch.rs	Wed Sep 22 11:33:29 2021 +0200
+++ b/rust/hg-core/src/dirstate_tree/dispatch.rs	Wed Sep 22 18:21:58 2021 +0200
@@ -37,7 +37,9 @@
     /// Remove information about all files in this map
     fn clear(&mut self);
 
-    fn set_v1(&mut self, filename: &HgPath, entry: DirstateEntry);
+    /// Add the given filename to the map if it is not already there, and
+    /// associate the given entry with it.
+    fn set_entry(&mut self, filename: &HgPath, entry: DirstateEntry);
 
     /// Add or change the information associated to a given file.
     ///
@@ -319,8 +321,8 @@
     ///
     /// XXX Is temporary during a refactor of V1 dirstate and will disappear
     /// shortly.
-    fn set_v1(&mut self, filename: &HgPath, entry: DirstateEntry) {
-        self.set_v1_inner(&filename, entry)
+    fn set_entry(&mut self, filename: &HgPath, entry: DirstateEntry) {
+        self.set_entry(&filename, entry)
     }
 
     fn add_file(