Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
47523:b76d54b90dc9 | 47524:69a463a4f193 |
---|---|
145 self._map | 145 self._map |
146 | 146 |
147 def addfile( | 147 def addfile( |
148 self, | 148 self, |
149 f, | 149 f, |
150 oldstate, | |
151 state, | 150 state, |
152 mode, | 151 mode, |
153 size=None, | 152 size=None, |
154 mtime=None, | 153 mtime=None, |
155 from_p2=False, | 154 from_p2=False, |
173 assert size != NONNORMAL | 172 assert size != NONNORMAL |
174 size = size & rangemask | 173 size = size & rangemask |
175 mtime = mtime & rangemask | 174 mtime = mtime & rangemask |
176 assert size is not None | 175 assert size is not None |
177 assert mtime is not None | 176 assert mtime is not None |
178 if oldstate in b"?r" and "_dirs" in self.__dict__: | 177 old_entry = self.get(f) |
178 if ( | |
179 old_entry is None or old_entry.removed | |
180 ) and "_dirs" in self.__dict__: | |
179 self._dirs.addpath(f) | 181 self._dirs.addpath(f) |
180 if oldstate == b"?" and "_alldirs" in self.__dict__: | 182 if old_entry is None and "_alldirs" in self.__dict__: |
181 self._alldirs.addpath(f) | 183 self._alldirs.addpath(f) |
182 self._map[f] = dirstatetuple(state, mode, size, mtime) | 184 self._map[f] = dirstatetuple(state, mode, size, mtime) |
183 if state != b'n' or mtime == AMBIGUOUS_TIME: | 185 if state != b'n' or mtime == AMBIGUOUS_TIME: |
184 self.nonnormalset.add(f) | 186 self.nonnormalset.add(f) |
185 if size == FROM_P2: | 187 if size == FROM_P2: |
457 ) | 459 ) |
458 | 460 |
459 def addfile( | 461 def addfile( |
460 self, | 462 self, |
461 f, | 463 f, |
462 oldstate, | |
463 state, | 464 state, |
464 mode, | 465 mode, |
465 size=None, | 466 size=None, |
466 mtime=None, | 467 mtime=None, |
467 from_p2=False, | 468 from_p2=False, |
468 possibly_dirty=False, | 469 possibly_dirty=False, |
469 ): | 470 ): |
470 return self._rustmap.addfile( | 471 return self._rustmap.addfile( |
471 f, | 472 f, |
472 oldstate, | |
473 state, | 473 state, |
474 mode, | 474 mode, |
475 size, | 475 size, |
476 mtime, | 476 mtime, |
477 from_p2, | 477 from_p2, |