Patchwork D11439: dirstate: use `reset_state` to drop file in `update_file_p1`

login
register
mail settings
Submitter phabricator
Date Sept. 16, 2021, 2:45 p.m.
Message ID <differential-rev-PHID-DREV-vkjexjrndlfq4bqsf2rq-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49755/
State Superseded
Headers show

Comments

phabricator - Sept. 16, 2021, 2:45 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The `dropfile` function is on its way out.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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
@@ -556,7 +556,8 @@ 
             possibly_dirty = True
         elif not (p1_tracked or wc_tracked):
             # the file is no longer relevant to anyone
-            if self._map.dropfile(filename):
+            if self._map.get(filename) is not None:
+                self._map.reset_state(filename)
                 self._dirty = True
                 self._updatedfiles.add(filename)
         elif (not p1_tracked) and wc_tracked: