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
--- a/mercurial/dirstate.py Wed Jul 07 19:31:52 2021 +0200
+++ b/mercurial/dirstate.py Wed Jul 07 19:32:22 2021 +0200
@@ -555,10 +555,14 @@
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.'''