##// END OF EJS Templates
scmutil: explicitly subclass the `Status` protocol...
Matt Harbison -
r53733:f5d134e5 default
parent child Browse files
Show More
@@ -7,6 +7,8
7
7
8 from __future__ import annotations
8 from __future__ import annotations
9
9
10 import abc
11
10 from typing import (
12 from typing import (
11 Iterator,
13 Iterator,
12 Protocol,
14 Protocol,
@@ -42,8 +44,10 class Status(Protocol):
42 clean: list[bytes]
44 clean: list[bytes]
43 """The list of files that are not in any other state."""
45 """The list of files that are not in any other state."""
44
46
47 @abc.abstractmethod
45 def __iter__(self) -> Iterator[list[bytes]]:
48 def __iter__(self) -> Iterator[list[bytes]]:
46 """Iterates over each of the categories of file lists."""
49 """Iterates over each of the categories of file lists."""
47
50
51 @abc.abstractmethod
48 def __repr__(self) -> str:
52 def __repr__(self) -> str:
49 """Creates a string representation of the file lists."""
53 """Creates a string representation of the file lists."""
@@ -64,6 +64,8 from . import (
64 vfs,
64 vfs,
65 )
65 )
66
66
67 from .interfaces import status as istatus
68
67 from .utils import (
69 from .utils import (
68 hashutil,
70 hashutil,
69 procutil,
71 procutil,
@@ -87,7 +89,7 termsize = scmplatform.termsize
87
89
88
90
89 @attr.s(slots=True, repr=False)
91 @attr.s(slots=True, repr=False)
90 class status:
92 class status(istatus.Status):
91 """Struct with a list of files per status.
93 """Struct with a list of files per status.
92
94
93 The 'deleted', 'unknown' and 'ignored' properties are only
95 The 'deleted', 'unknown' and 'ignored' properties are only
General Comments 0
You need to be logged in to leave comments. Login now