Mercurial > public > mercurial-scm > hg-stable
diff 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 |
line wrap: on
line diff
--- a/mercurial/interfaces/repository.py Tue Feb 11 22:44:21 2025 -0500 +++ b/mercurial/interfaces/repository.py Fri Feb 07 23:00:31 2025 +0100 @@ -30,6 +30,11 @@ ByteString, # TODO: change to Buffer for 3.14 ) + from ._basetypes import ( + UiT as Ui, + VfsT as Vfs, + ) + from . import ( dirstate as intdirstate, matcher, @@ -39,12 +44,6 @@ # TODO: make a protocol class for this NodeConstants = Any - # TODO: create a Protocol class, since importing uimod here causes a cycle - # that confuses pytype. - Ui = Any - - # TODO: make a protocol class for this - Vfs = Any # Local repository feature string.