Mercurial > public > mercurial-scm > hg
diff mercurial/dirstatemap.py @ 47524:69a463a4f193
dirstate: no longer pass the `oldstate` value to the dirstatemap
The dirstatemap already have this information.
Differential Revision: https://phab.mercurial-scm.org/D10966
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 03 Jul 2021 20:59:26 +0200 |
parents | abed645b8e96 |
children | fe4641cf9b72 |
line wrap: on
line diff
--- a/mercurial/dirstatemap.py Sat Jul 03 20:57:44 2021 +0200 +++ b/mercurial/dirstatemap.py Sat Jul 03 20:59:26 2021 +0200 @@ -147,7 +147,6 @@ def addfile( self, f, - oldstate, state, mode, size=None, @@ -175,9 +174,12 @@ mtime = mtime & rangemask assert size is not None assert mtime is not None - if oldstate in b"?r" and "_dirs" in self.__dict__: + old_entry = self.get(f) + if ( + old_entry is None or old_entry.removed + ) and "_dirs" in self.__dict__: self._dirs.addpath(f) - if oldstate == b"?" and "_alldirs" in self.__dict__: + if old_entry is None and "_alldirs" in self.__dict__: self._alldirs.addpath(f) self._map[f] = dirstatetuple(state, mode, size, mtime) if state != b'n' or mtime == AMBIGUOUS_TIME: @@ -459,7 +461,6 @@ def addfile( self, f, - oldstate, state, mode, size=None, @@ -469,7 +470,6 @@ ): return self._rustmap.addfile( f, - oldstate, state, mode, size,