Patchwork D12461: dirstatemap: move `set_untracked` out of the common methods

login
register
mail settings
Submitter phabricator
Date April 6, 2022, 2:12 p.m.
Message ID <differential-rev-PHID-DREV-2vmov44yk7iuy2cadg7f-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50806/
State New
Headers show

Comments

phabricator - April 6, 2022, 2:12 p.m.
Alphare created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  There is a dedicated Rust implementation now

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12461

AFFECTED FILES
  mercurial/dirstatemap.py

CHANGE DETAILS




To: Alphare, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/dirstatemap.py b/mercurial/dirstatemap.py
--- a/mercurial/dirstatemap.py
+++ b/mercurial/dirstatemap.py
@@ -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)