Mercurial > hg
comparison mercurial/dirstatemap.py @ 47535:6025353c9c55
dirstate: no longer pass `oldstate` to the `dropfile`
The `oldstate` value come literally from `_map` so we don't need to pass tha
information along.
Differential Revision: https://phab.mercurial-scm.org/D10978
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 04 Jul 2021 02:28:08 +0200 |
parents | a1745a292885 |
children | 84391ddf4c78 |
comparison
equal
deleted
inserted
replaced
47534:e53a42dce923 | 47535:6025353c9c55 |
---|---|
233 normed = util.normcase(f) | 233 normed = util.normcase(f) |
234 self.filefoldmap.pop(normed, None) | 234 self.filefoldmap.pop(normed, None) |
235 self._map[f] = dirstatetuple(b'r', 0, size, 0) | 235 self._map[f] = dirstatetuple(b'r', 0, size, 0) |
236 self.nonnormalset.add(f) | 236 self.nonnormalset.add(f) |
237 | 237 |
238 def dropfile(self, f, oldstate): | 238 def dropfile(self, f): |
239 """ | 239 """ |
240 Remove a file from the dirstate. Returns True if the file was | 240 Remove a file from the dirstate. Returns True if the file was |
241 previously recorded. | 241 previously recorded. |
242 """ | 242 """ |
243 exists = self._map.pop(f, None) is not None | 243 old_entry = self._map.pop(f, None) |
244 exists = False | |
245 oldstate = b'?' | |
246 if old_entry is not None: | |
247 exists = True | |
248 oldstate = old_entry.state | |
244 if exists: | 249 if exists: |
245 if oldstate != b"r" and "_dirs" in self.__dict__: | 250 if oldstate != b"r" and "_dirs" in self.__dict__: |
246 self._dirs.delpath(f) | 251 self._dirs.delpath(f) |
247 if "_alldirs" in self.__dict__: | 252 if "_alldirs" in self.__dict__: |
248 self._alldirs.delpath(f) | 253 self._alldirs.delpath(f) |