##// END OF EJS Templates
interfaces: add a Protocol class for `scmutil.status`...
Matt Harbison -
r53347:a1c0f19e default
parent child Browse files
Show More
@@ -0,0 +1,49
1 # status.py - Type annotations for status related objects
2 #
3 # Copyright Matt Harbison <mharbison72@gmail.com>
4 #
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
7
8 from __future__ import annotations
9
10 from typing import (
11 Iterator,
12 Protocol,
13 )
14
15
16 class Status(Protocol):
17 """Struct with a list of files per status.
18
19 The 'deleted', 'unknown' and 'ignored' properties are only
20 relevant to the working copy.
21 """
22
23 modified: list[bytes]
24 """The list of files with modifications."""
25
26 added: list[bytes]
27 """The list of files that started being tracked."""
28
29 removed: list[bytes]
30 """The list of files that stopped being tracked."""
31
32 deleted: list[bytes]
33 """The list of files in the working directory that are deleted from the
34 file system (but not in the removed state)."""
35
36 unknown: list[bytes]
37 """The list of files in the working directory that are not tracked."""
38
39 ignored: list[bytes]
40 """The list of files in the working directory that are ignored."""
41
42 clean: list[bytes]
43 """The list of files that are not in any other state."""
44
45 def __iter__(self) -> Iterator[list[bytes]]:
46 """Iterates over each of the categories of file lists."""
47
48 def __repr__(self) -> str:
49 """Creates a string representation of the file lists."""
General Comments 0
You need to be logged in to leave comments. Login now