Commit f79730fd authored by Simon Sapin's avatar Simon Sapin
Browse files

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
parent 50dca3aa5c3b
......@@ -322,15 +322,15 @@ class DirstateItem(object):
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"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment