Mercurial > hg
changeset 49109:953b08a2d983
dirstatemap: move `set_untracked` out of the common methods
There is a dedicated Rust implementation now
Differential Revision: https://phab.mercurial-scm.org/D12507
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Mon, 28 Mar 2022 18:15:11 +0200 |
parents | 119c7e2b4248 |
children | 4d3f6767319f |
files | mercurial/dirstatemap.py |
diffstat | 1 files changed, 16 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- 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)