changeset 48229:db5897321351

dirstate-v2: Use attributes as intended instead of properties in v2_data() The property return other integer values instead of None, so `is not None` does not work. This fixes test-dirstate-race.t in pure-Python mode, which currently fails on the default branch. Differential Revision: https://phab.mercurial-scm.org/D11660
author Simon Sapin <simon.sapin@octobus.net>
date Thu, 14 Oct 2021 15:05:04 +0200
parents 50dca3aa5c3b
children 7ed0fc687220
files mercurial/pure/parsers.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/pure/parsers.py	Thu Oct 14 13:59:18 2021 +0200
+++ b/mercurial/pure/parsers.py	Thu Oct 14 15:05:04 2021 +0200
@@ -322,15 +322,15 @@
             flags |= DIRSTATE_V2_P1_TRACKED
         if self._p2_info:
             flags |= DIRSTATE_V2_P2_INFO
-        if self.mode is not None and self.size is not None:
+        if self._mode is not None and self._size is not None:
             flags |= DIRSTATE_V2_HAS_MODE_AND_SIZE
             if self.mode & stat.S_IXUSR:
                 flags |= DIRSTATE_V2_MODE_EXEC_PERM
             if stat.S_ISLNK(self.mode):
                 flags |= DIRSTATE_V2_MODE_IS_SYMLINK
-        if self.mtime is not None:
+        if self._mtime is not None:
             flags |= DIRSTATE_V2_HAS_MTIME
-        return (flags, self.size or 0, self.mtime or 0)
+        return (flags, self._size or 0, self._mtime or 0)
 
     def v1_state(self):
         """return a "state" suitable for v1 serialization"""