Patchwork D11313: dirstate: directly call the dirstatemap in `set_untracked`

login
register
mail settings
Submitter phabricator
Date Aug. 21, 2021, 9:55 a.m.
Message ID <differential-rev-PHID-DREV-kktgnix3g5lelmob32xk-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49627/
State Superseded
Headers show

Comments

phabricator - Aug. 21, 2021, 9:55 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This function is only called in two places: the deprecated "remove" method and
  in the new `set_untracked` method.
  
  So we simply inline the appropriate content in `set_untraked`, paving the way
  to dropping the deprecated code and its associated function.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -500,7 +500,9 @@ 
             self._drop(filename)
             return True
         else:
-            self._remove(filename)
+            self._dirty = True
+            self._updatedfiles.add(filename)
+            self._map.removefile(filename, in_merge=self.in_merge)
             return True
 
     @requires_no_parents_change