Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/interfaces/repository.py @ 52914:3e8a3db5f5e8
typing: introduce a few basic alias for common types
These types are passed everywhere. We introduce basic alias to Any, to make it
simpler to start annotating code prior to introducing proper protocol for them.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 07 Feb 2025 23:00:31 +0100 |
parents | 4fa0d89d1bdb |
children |
comparison
equal
deleted
inserted
replaced
52913:6ee3c401882b | 52914:3e8a3db5f5e8 |
---|---|
28 if typing.TYPE_CHECKING: | 28 if typing.TYPE_CHECKING: |
29 from typing import ( | 29 from typing import ( |
30 ByteString, # TODO: change to Buffer for 3.14 | 30 ByteString, # TODO: change to Buffer for 3.14 |
31 ) | 31 ) |
32 | 32 |
33 from ._basetypes import ( | |
34 UiT as Ui, | |
35 VfsT as Vfs, | |
36 ) | |
37 | |
33 from . import ( | 38 from . import ( |
34 dirstate as intdirstate, | 39 dirstate as intdirstate, |
35 matcher, | 40 matcher, |
36 misc, | 41 misc, |
37 ) | 42 ) |
38 | 43 |
39 # TODO: make a protocol class for this | 44 # TODO: make a protocol class for this |
40 NodeConstants = Any | 45 NodeConstants = Any |
41 | 46 |
42 # TODO: create a Protocol class, since importing uimod here causes a cycle | |
43 # that confuses pytype. | |
44 Ui = Any | |
45 | |
46 # TODO: make a protocol class for this | |
47 Vfs = Any | |
48 | 47 |
49 # Local repository feature string. | 48 # Local repository feature string. |
50 | 49 |
51 # Revlogs are being used for file storage. | 50 # Revlogs are being used for file storage. |
52 REPO_FEATURE_REVLOG_FILE_STORAGE = b'revlogfilestorage' | 51 REPO_FEATURE_REVLOG_FILE_STORAGE = b'revlogfilestorage' |