equal
deleted
inserted
replaced
52 DIRSTATE_V2_HAS_FILE_MTIME = 1 << 4 |
52 DIRSTATE_V2_HAS_FILE_MTIME = 1 << 4 |
53 _DIRSTATE_V2_HAS_DIRCTORY_MTIME = 1 << 5 # Unused when Rust is not available |
53 _DIRSTATE_V2_HAS_DIRCTORY_MTIME = 1 << 5 # Unused when Rust is not available |
54 DIRSTATE_V2_MODE_EXEC_PERM = 1 << 6 |
54 DIRSTATE_V2_MODE_EXEC_PERM = 1 << 6 |
55 DIRSTATE_V2_MODE_IS_SYMLINK = 1 << 7 |
55 DIRSTATE_V2_MODE_IS_SYMLINK = 1 << 7 |
56 DIRSTATE_V2_EXPECTED_STATE_IS_MODIFIED = 1 << 8 |
56 DIRSTATE_V2_EXPECTED_STATE_IS_MODIFIED = 1 << 8 |
|
57 DIRSTATE_V2_ALL_UNKNOWN_RECORDED = 1 << 9 |
|
58 DIRSTATE_V2_ALL_IGNORED_RECORDED = 1 << 10 |
57 |
59 |
58 |
60 |
59 @attr.s(slots=True, init=False) |
61 @attr.s(slots=True, init=False) |
60 class DirstateItem(object): |
62 class DirstateItem(object): |
61 """represent a dirstate entry |
63 """represent a dirstate entry |
338 flags |= DIRSTATE_V2_MODE_EXEC_PERM |
340 flags |= DIRSTATE_V2_MODE_EXEC_PERM |
339 if stat.S_ISLNK(self.mode): |
341 if stat.S_ISLNK(self.mode): |
340 flags |= DIRSTATE_V2_MODE_IS_SYMLINK |
342 flags |= DIRSTATE_V2_MODE_IS_SYMLINK |
341 if self._mtime is not None: |
343 if self._mtime is not None: |
342 flags |= DIRSTATE_V2_HAS_FILE_MTIME |
344 flags |= DIRSTATE_V2_HAS_FILE_MTIME |
|
345 # Note: we do not need to do anything regarding |
|
346 # DIRSTATE_V2_ALL_UNKNOWN_RECORDED and DIRSTATE_V2_ALL_IGNORED_RECORDED |
|
347 # since we never set _DIRSTATE_V2_HAS_DIRCTORY_MTIME |
343 return (flags, self._size or 0, self._mtime or 0) |
348 return (flags, self._size or 0, self._mtime or 0) |
344 |
349 |
345 def v1_state(self): |
350 def v1_state(self): |
346 """return a "state" suitable for v1 serialization""" |
351 """return a "state" suitable for v1 serialization""" |
347 if not self.any_tracked: |
352 if not self.any_tracked: |