Changeset View
Changeset View
Standalone View
Standalone View
mercurial/pure/parsers.py
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | |||||
DIRSTATE_V2_MODE_IS_SYMLINK = 1 << 7 | DIRSTATE_V2_MODE_IS_SYMLINK = 1 << 7 | ||||
DIRSTATE_V2_EXPECTED_STATE_IS_MODIFIED = 1 << 8 | DIRSTATE_V2_EXPECTED_STATE_IS_MODIFIED = 1 << 8 | ||||
DIRSTATE_V2_ALL_UNKNOWN_RECORDED = 1 << 9 | DIRSTATE_V2_ALL_UNKNOWN_RECORDED = 1 << 9 | ||||
DIRSTATE_V2_ALL_IGNORED_RECORDED = 1 << 10 | DIRSTATE_V2_ALL_IGNORED_RECORDED = 1 << 10 | ||||
DIRSTATE_V2_HAS_FALLBACK_EXEC = 1 << 11 | DIRSTATE_V2_HAS_FALLBACK_EXEC = 1 << 11 | ||||
DIRSTATE_V2_FALLBACK_EXEC = 1 << 12 | DIRSTATE_V2_FALLBACK_EXEC = 1 << 12 | ||||
DIRSTATE_V2_HAS_FALLBACK_SYMLINK = 1 << 13 | DIRSTATE_V2_HAS_FALLBACK_SYMLINK = 1 << 13 | ||||
DIRSTATE_V2_FALLBACK_SYMLINK = 1 << 14 | DIRSTATE_V2_FALLBACK_SYMLINK = 1 << 14 | ||||
DIRSTATE_V2_MTIME_SECOND_AMBIGUOUS = 1 << 15 | |||||
@attr.s(slots=True, init=False) | @attr.s(slots=True, init=False) | ||||
class DirstateItem(object): | class DirstateItem(object): | ||||
"""represent a dirstate entry | """represent a dirstate entry | ||||
It hold multiple attributes | It hold multiple attributes | ||||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Line(s) | ): | ||||
if has_meaningful_mtime: | if has_meaningful_mtime: | ||||
self._mtime_s, self._mtime_ns = parentfiledata[2] | self._mtime_s, self._mtime_ns = parentfiledata[2] | ||||
@classmethod | @classmethod | ||||
def from_v2_data(cls, flags, size, mtime_s, mtime_ns): | def from_v2_data(cls, flags, size, mtime_s, mtime_ns): | ||||
"""Build a new DirstateItem object from V2 data""" | """Build a new DirstateItem object from V2 data""" | ||||
has_mode_size = bool(flags & DIRSTATE_V2_HAS_MODE_AND_SIZE) | has_mode_size = bool(flags & DIRSTATE_V2_HAS_MODE_AND_SIZE) | ||||
has_meaningful_mtime = bool(flags & DIRSTATE_V2_HAS_FILE_MTIME) | has_meaningful_mtime = bool(flags & DIRSTATE_V2_HAS_FILE_MTIME) | ||||
if flags & DIRSTATE_V2_MTIME_SECOND_AMBIGUOUS: | |||||
# The current code is not able to do the more subtle comparison that the | |||||
# MTIME_SECOND_AMBIGUOUS requires. So we ignore the mtime | |||||
has_meaningful_mtime = False | |||||
mode = None | mode = None | ||||
if flags & +DIRSTATE_V2_EXPECTED_STATE_IS_MODIFIED: | if flags & +DIRSTATE_V2_EXPECTED_STATE_IS_MODIFIED: | ||||
# we do not have support for this flag in the code yet, | # we do not have support for this flag in the code yet, | ||||
# force a lookup for this file. | # force a lookup for this file. | ||||
has_mode_size = False | has_mode_size = False | ||||
has_meaningful_mtime = False | has_meaningful_mtime = False | ||||
▲ Show 20 Lines • Show All 778 Lines • Show Last 20 Lines |