changeset 47523:b76d54b90dc9

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
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 03 Jul 2021 20:57:44 +0200
parents 587bb99ea311
children 69a463a4f193
files mercurial/dirstate.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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')