# HG changeset patch # User Pierre-Yves David # Date 2021-07-03 18:57:44 # 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 --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -451,7 +451,8 @@ class dirstate(object): 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')