[Updated] D11314: dirstate: forward `remove` call to newer `API`

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Fri Aug 27 12:37:39 UTC 2021


Closed by commit rHG6614ab9f061d: dirstate: forward `remove` call to newer `API` (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D11314?vs=30040&id=30082

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11314/new/

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

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -858,13 +858,14 @@
                 b'6.0',
                 stacklevel=2,
             )
-        self._remove(f)
-
-    def _remove(self, filename):
-        """internal function to mark a file removed"""
         self._dirty = True
-        self._updatedfiles.add(filename)
-        self._map.removefile(filename, in_merge=self.in_merge)
+        self._updatedfiles.add(f)
+        entry = self._map.get(f)
+        if entry is None:
+            # Assuming we are in a update/merge case
+            self.update_file(f, p1_tracked=True, wc_tracked=False)
+        else:
+            self.set_untracked(f)
 
     def merge(self, f):
         '''Mark a file merged.'''



To: marmoute, #hg-reviewers, Alphare
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210827/ffca031f/attachment-0002.html>


More information about the Mercurial-patches mailing list