dirstatemap: also discard item from sets
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 20 Aug 2021 16:12:33 +0200
changeset 47907 bbae583333e9
parent 47906 50ded8854f8d
child 47908 74a8d5c6fdc6
dirstatemap: also discard item from sets This seems more consistent to do that. I don't think any test was actually barking about it, but the code feels a bit more robust now. Differential Revision: https://phab.mercurial-scm.org/D11332
mercurial/dirstatemap.py
--- a/mercurial/dirstatemap.py	Fri Jul 16 18:25:01 2021 +0200
+++ b/mercurial/dirstatemap.py	Fri Aug 20 16:12:33 2021 +0200
@@ -199,8 +199,12 @@
         self._map[f] = new_entry
         if new_entry.dm_nonnormal:
             self.nonnormalset.add(f)
+        else:
+            self.nonnormalset.discard(f)
         if new_entry.dm_otherparent:
             self.otherparentset.add(f)
+        else:
+            self.otherparentset.discard(f)
 
     def reset_state(
         self,