Patchwork D11332: dirstatemap: also discard item from sets

login
register
mail settings
Submitter phabricator
Date Aug. 21, 2021, 9:57 a.m.
Message ID <differential-rev-PHID-DREV-cferb5wbljyt2ctydpku-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49645/
State Superseded
Headers show

Comments

phabricator - Aug. 21, 2021, 9:57 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D11332

AFFECTED FILES
  mercurial/dirstatemap.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/dirstatemap.py b/mercurial/dirstatemap.py
--- a/mercurial/dirstatemap.py
+++ b/mercurial/dirstatemap.py
@@ -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,