changeset 49105:a69ea5a3c5a5

dirstatemap: move `set_clean` out of common methods This now has a dedicated Rust implementation Differential Revision: https://phab.mercurial-scm.org/D12503
author Raphaël Gomès <rgomes@octobus.net>
date Mon, 28 Mar 2022 18:02:45 +0200
parents b5c2aca84618
children c1a3fdedc492
files mercurial/dirstatemap.py
diffstat 1 files changed, 11 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstatemap.py	Mon Mar 28 18:02:50 2022 +0200
+++ b/mercurial/dirstatemap.py	Mon Mar 28 18:02:45 2022 +0200
@@ -116,14 +116,6 @@
         entry.set_possibly_dirty()
         self._refresh_entry(filename, entry)
 
-    def set_clean(self, filename, mode, size, mtime):
-        """mark a file as back to a clean state"""
-        entry = self[filename]
-        size = size & rangemask
-        entry.set_clean(mode, size, mtime)
-        self._refresh_entry(filename, entry)
-        self.copymap.pop(filename, None)
-
     def set_untracked(self, f):
         """Mark a file as no longer tracked in the dirstate map"""
         entry = self.get(f)
@@ -531,6 +523,14 @@
             self._refresh_entry(filename, entry)
         return new
 
+    def set_clean(self, filename, mode, size, mtime):
+        """mark a file as back to a clean state"""
+        entry = self[filename]
+        size = size & rangemask
+        entry.set_clean(mode, size, mtime)
+        self._refresh_entry(filename, entry)
+        self.copymap.pop(filename, None)
+
     def _refresh_entry(self, f, entry):
         if not entry.any_tracked:
             self._map.pop(f, None)
@@ -712,6 +712,9 @@
         def set_tracked(self, f):
             return self._map.set_tracked(f)
 
+        def set_clean(self, filename, mode, size, mtime):
+            self._map.set_clean(filename, mode, size, mtime)
+
         def reset_state(
             self,
             filename,