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
--- 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')