# HG changeset patch # User Pierre-Yves David # Date 2021-07-07 17:32:22 # Node ID c5190adc17d593f671fc704efa1f667e9edf264e # Parent f5c24c124e07d4f26d928bc95e7db1c1a1e1023d dirstate: introduce an internal `_remove` method We want to split current user of `dirstate.remove` between `hg rm`-like cases and update of the dirstate coming from update/merge. To do this we will introduce new API. The first step is to introduces an internal function that these new API migh use (or not use) to distinct between the migrated users and the others. Differential Revision: https://phab.mercurial-scm.org/D11011 diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -555,10 +555,14 @@ class dirstate(object): self._map.copymap.pop(filename, None) def remove(self, f): - '''Mark a file removed.''' + '''Mark a file removed''' + self._remove(f) + + def _remove(self, filename): + """internal function to mark a file removed""" self._dirty = True - self._updatedfiles.add(f) - self._map.removefile(f, in_merge=self.in_merge) + self._updatedfiles.add(filename) + self._map.removefile(filename, in_merge=self.in_merge) def merge(self, f): '''Mark a file merged.'''