dirstatemap: small rework of the `set_untracked` method
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 01 Oct 2021 18:49:21 +0200
changeset 48136 08e04bb0bff3
parent 48135 771c90807a2b
child 48137 de793f249852
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
mercurial/dirstatemap.py
--- 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