This simplify more code.
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/pure/parsers.py (6 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
76312026450f | ae19a8587aff | Pierre-Yves David | Sep 30 2021, 9:50 PM |
Status | Author | Revision | |
---|---|---|---|
Abandoned | marmoute | ||
Abandoned | marmoute | ||
Abandoned | marmoute | ||
Abandoned | marmoute | ||
Abandoned | marmoute | ||
Abandoned | marmoute | ||
Abandoned | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute |
m needs merging | m needs merging | ||||
r marked for removal | r marked for removal | ||||
a marked for addition | a marked for addition | ||||
XXX This "state" is a bit obscure and mostly a direct expression of the | XXX This "state" is a bit obscure and mostly a direct expression of the | ||||
dirstatev1 format. It would make sense to ultimately deprecate it in | dirstatev1 format. It would make sense to ultimately deprecate it in | ||||
favor of the more "semantic" attributes. | favor of the more "semantic" attributes. | ||||
""" | """ | ||||
if not (self._p1_tracked or self._p2_tracked or self._wc_tracked): | if not self.any_tracked: | ||||
return b'?' | return b'?' | ||||
return self.v1_state() | return self.v1_state() | ||||
@property | @property | ||||
def tracked(self): | def tracked(self): | ||||
"""True is the file is tracked in the working copy""" | """True is the file is tracked in the working copy""" | ||||
return self._wc_tracked | return self._wc_tracked | ||||
return b'n' | return b'n' | ||||
def v1_mode(self): | def v1_mode(self): | ||||
"""return a "mode" suitable for v1 serialization""" | """return a "mode" suitable for v1 serialization""" | ||||
return self._mode if self._mode is not None else 0 | return self._mode if self._mode is not None else 0 | ||||
def v1_size(self): | def v1_size(self): | ||||
"""return a "size" suitable for v1 serialization""" | """return a "size" suitable for v1 serialization""" | ||||
if not (self._p1_tracked or self._p2_tracked or self._wc_tracked): | if not self.any_tracked: | ||||
# the object has no state to record, this is -currently- | # the object has no state to record, this is -currently- | ||||
# unsupported | # unsupported | ||||
raise RuntimeError('untracked item') | raise RuntimeError('untracked item') | ||||
elif self.removed and self._merged: | elif self.removed and self._merged: | ||||
return NONNORMAL | return NONNORMAL | ||||
elif self.removed and self._clean_p2: | elif self.removed and self._clean_p2: | ||||
return FROM_P2 | return FROM_P2 | ||||
elif self.removed: | elif self.removed: | ||||
return 0 | return 0 | ||||
elif self.merged: | elif self.merged: | ||||
return FROM_P2 | return FROM_P2 | ||||
elif self.added: | elif self.added: | ||||
return NONNORMAL | return NONNORMAL | ||||
elif self.from_p2: | elif self.from_p2: | ||||
return FROM_P2 | return FROM_P2 | ||||
elif self._possibly_dirty: | elif self._possibly_dirty: | ||||
return self._size if self._size is not None else NONNORMAL | return self._size if self._size is not None else NONNORMAL | ||||
else: | else: | ||||
return self._size | return self._size | ||||
def v1_mtime(self): | def v1_mtime(self): | ||||
"""return a "mtime" suitable for v1 serialization""" | """return a "mtime" suitable for v1 serialization""" | ||||
if not (self._p1_tracked or self._p2_tracked or self._wc_tracked): | if not self.any_tracked: | ||||
# the object has no state to record, this is -currently- | # the object has no state to record, this is -currently- | ||||
# unsupported | # unsupported | ||||
raise RuntimeError('untracked item') | raise RuntimeError('untracked item') | ||||
elif self.removed: | elif self.removed: | ||||
return 0 | return 0 | ||||
elif self._possibly_dirty: | elif self._possibly_dirty: | ||||
return AMBIGUOUS_TIME | return AMBIGUOUS_TIME | ||||
elif self.merged: | elif self.merged: |