mercurial/pure/parsers.py
changeset 47664 119b9c8db94d
parent 47569 7a4ba68f2373
child 47665 a4443f66be6a
equal deleted inserted replaced
47663:6f8d6dd32e61 47664:119b9c8db94d
    42 
    42 
    43 # a special value used internally for `time` if the time is ambigeous
    43 # a special value used internally for `time` if the time is ambigeous
    44 AMBIGUOUS_TIME = -1
    44 AMBIGUOUS_TIME = -1
    45 
    45 
    46 
    46 
    47 @attr.s(slots=True)
    47 @attr.s(slots=True, init=False)
    48 class DirstateItem(object):
    48 class DirstateItem(object):
    49     """represent a dirstate entry
    49     """represent a dirstate entry
    50 
    50 
    51     It contains:
    51     It contains:
    52 
    52 
    58 
    58 
    59     _state = attr.ib()
    59     _state = attr.ib()
    60     _mode = attr.ib()
    60     _mode = attr.ib()
    61     _size = attr.ib()
    61     _size = attr.ib()
    62     _mtime = attr.ib()
    62     _mtime = attr.ib()
       
    63 
       
    64     def __init__(self, state, mode, size, mtime):
       
    65         self._state = state
       
    66         self._mode = mode
       
    67         self._size = size
       
    68         self._mtime = mtime
    63 
    69 
    64     def __getitem__(self, idx):
    70     def __getitem__(self, idx):
    65         if idx == 0 or idx == -4:
    71         if idx == 0 or idx == -4:
    66             msg = b"do not use item[x], use item.state"
    72             msg = b"do not use item[x], use item.state"
    67             util.nouideprecwarn(msg, b'6.0', stacklevel=2)
    73             util.nouideprecwarn(msg, b'6.0', stacklevel=2)