dirstatemap: move `set_untracked` out of the common methods
There is a dedicated Rust implementation now
Differential Revision: https://phab.mercurial-scm.org/D12507
--- 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)