dirstate: stop using `oldstate` in `dirstate._addpath`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sat, 03 Jul 2021 20:57:44 +0200
changeset 47523 b76d54b90dc9
parent 47522 587bb99ea311
child 47524 69a463a4f193
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
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')