# HG changeset patch # User Pierre-Yves David # Date 1625731523 -7200 # Node ID 3d8b639bfbaa6c6a500a12c294e65ab2c684d1c7 # Parent c5190adc17d593f671fc704efa1f667e9edf264e dirstate: introduce an internal `_drop` method We want to split current user of `dirstate.drop` 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/D11023 diff -r c5190adc17d5 -r 3d8b639bfbaa mercurial/dirstate.py --- a/mercurial/dirstate.py Wed Jul 07 19:32:22 2021 +0200 +++ b/mercurial/dirstate.py Thu Jul 08 10:05:23 2021 +0200 @@ -572,10 +572,14 @@ def drop(self, f): '''Drop a file from the dirstate''' - if self._map.dropfile(f): + self._drop(f) + + def _drop(self, filename): + """internal function to drop a file from the dirstate""" + if self._map.dropfile(filename): self._dirty = True - self._updatedfiles.add(f) - self._map.copymap.pop(f, None) + self._updatedfiles.add(filename) + self._map.copymap.pop(filename, None) def _discoverpath(self, path, normed, ignoremissing, exists, storemap): if exists is None: @@ -689,7 +693,7 @@ for f in to_lookup: self.normallookup(f) for f in to_drop: - self.drop(f) + self._drop(f) self._dirty = True