dirstate-v2: Use attributes as intended instead of properties in v2_data()
authorSimon Sapin <simon.sapin@octobus.net>
Thu, 14 Oct 2021 15:05:04 +0200
changeset 48241 db5897321351
parent 48240 50dca3aa5c3b
child 48242 7ed0fc687220
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
mercurial/pure/parsers.py
--- 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"""