diff mercurial/dirstatemap.py @ 47685:265cdfaad372

dirstate-item: introduce a `dm_nonnormal` property See inline documentation for details. Differential Revision: https://phab.mercurial-scm.org/D11123
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 14 Jul 2021 21:59:18 +0200
parents 284a20269a97
children e43128ee436f
line wrap: on
line diff
--- a/mercurial/dirstatemap.py	Fri Jul 16 16:19:31 2021 +0200
+++ b/mercurial/dirstatemap.py	Wed Jul 14 21:59:18 2021 +0200
@@ -196,8 +196,8 @@
             self._dirs.addpath(f)
         if old_entry is None and "_alldirs" in self.__dict__:
             self._alldirs.addpath(f)
-        self._map[f] = DirstateItem(state, mode, size, mtime)
-        if state != b'n' or mtime == AMBIGUOUS_TIME:
+        e = self._map[f] = DirstateItem(state, mode, size, mtime)
+        if e.dm_nonnormal:
             self.nonnormalset.add(f)
         if size == FROM_P2:
             self.otherparentset.add(f)
@@ -274,7 +274,7 @@
             nonnorm = set()
             otherparent = set()
             for fname, e in pycompat.iteritems(self._map):
-                if e.state != b'n' or e.mtime == AMBIGUOUS_TIME:
+                if e.dm_nonnormal:
                     nonnorm.add(fname)
                 if e.from_p2:
                     otherparent.add(fname)