# HG changeset patch # User Pierre-Yves David # Date 1625338664 -7200 # Node ID b76d54b90dc93a10d22289cf91fc957c10ca3230 # Parent 587bb99ea3114c091de5efa5c80ad468ba56f894 dirstate: stop using `oldstate` in `dirstate._addpath` We don't need to pass the oldstate around, so lets use the new property instead. Differential Revision: https://phab.mercurial-scm.org/D10965 diff -r 587bb99ea311 -r b76d54b90dc9 mercurial/dirstate.py --- a/mercurial/dirstate.py Sat Jul 03 20:53:52 2021 +0200 +++ b/mercurial/dirstate.py Sat Jul 03 20:57:44 2021 +0200 @@ -451,7 +451,8 @@ possibly_dirty=False, ): oldstate = self[f] - if state == b'a' or oldstate == b'r': + entry = self._map.get(f) + if state == b'a' or entry is not None and entry.removed: scmutil.checkfilename(f) if self._map.hastrackeddir(f): msg = _(b'directory %r already in dirstate')