dirstatemap: move `set_untracked` out of the common methods
authorRaphaël Gomès <rgomes@octobus.net>
Mon, 28 Mar 2022 18:15:11 +0200
changeset 49109 953b08a2d983
parent 49108 119c7e2b4248
child 49110 4d3f6767319f
dirstatemap: move `set_untracked` out of the common methods There is a dedicated Rust implementation now Differential Revision: https://phab.mercurial-scm.org/D12507
mercurial/dirstatemap.py
--- a/mercurial/dirstatemap.py	Mon Mar 28 18:13:58 2022 +0200
+++ b/mercurial/dirstatemap.py	Mon Mar 28 18:15:11 2022 +0200
@@ -108,21 +108,6 @@
 
         The fact we actually need to drop it is the responsability of the caller"""
 
-    ### method to manipulate the entries
-
-    def set_untracked(self, f):
-        """Mark a file as no longer tracked in the dirstate map"""
-        entry = self.get(f)
-        if entry is None:
-            return False
-        else:
-            self._dirs_decr(f, old_entry=entry, remove_variant=not entry.added)
-            if not entry.p2_info:
-                self.copymap.pop(f, None)
-            entry.set_untracked()
-            self._refresh_entry(f, entry)
-            return True
-
     ### disk interaction
 
     def _opendirstatefile(self):
@@ -517,6 +502,19 @@
             self._refresh_entry(filename, entry)
         return new
 
+    def set_untracked(self, f):
+        """Mark a file as no longer tracked in the dirstate map"""
+        entry = self.get(f)
+        if entry is None:
+            return False
+        else:
+            self._dirs_decr(f, old_entry=entry, remove_variant=not entry.added)
+            if not entry.p2_info:
+                self.copymap.pop(f, None)
+            entry.set_untracked()
+            self._refresh_entry(f, entry)
+            return True
+
     def set_clean(self, filename, mode, size, mtime):
         """mark a file as back to a clean state"""
         entry = self[filename]
@@ -712,6 +710,9 @@
         def set_tracked(self, f):
             return self._map.set_tracked(f)
 
+        def set_untracked(self, f):
+            return self._map.set_untracked(f)
+
         def set_clean(self, filename, mode, size, mtime):
             self._map.set_clean(filename, mode, size, mtime)