Patchwork D11569: dirstatemap: small rework of the `set_untracked` method

login
register
mail settings
Submitter phabricator
Date Oct. 2, 2021, 3:05 p.m.
Message ID <differential-rev-PHID-DREV-hvji6idbayylijcp5ve3-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49893/
State Superseded
Headers show

Comments

phabricator - Oct. 2, 2021, 3:05 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This shuffle the code a bit to have it flowing more "naturally". This will help
  us to create a common version of this code in the next changesets.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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
@@ -479,10 +479,9 @@ 
             self._dirs_decr(f, old_entry=entry, remove_variant=not entry.added)
             if not entry.merged:
                 self.copymap.pop(f, None)
-            if entry.added:
+            entry.set_untracked()
+            if not entry.any_tracked:
                 self._map.pop(f, None)
-            else:
-                entry.set_untracked()
             return True