changeset 48124:08e04bb0bff3

dirstatemap: small rework of the `set_untracked` method 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. Differential Revision: https://phab.mercurial-scm.org/D11569
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 01 Oct 2021 18:49:21 +0200
parents 771c90807a2b
children de793f249852
files mercurial/dirstatemap.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstatemap.py	Sat Oct 02 12:10:46 2021 +0200
+++ b/mercurial/dirstatemap.py	Fri Oct 01 18:49:21 2021 +0200
@@ -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