Mercurial > public > mercurial-scm > hg-stable
changeset 52909:4fa0d89d1bdb
typing: use the IPath interface instead of external import
We are breaking the cycle further.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 16 Feb 2025 01:20:24 +0100 |
parents | 180591a9a6a1 |
children | 9b85f6efcc1d |
files | mercurial/interfaces/repository.py |
diffstat | 1 files changed, 4 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/interfaces/repository.py Mon Feb 10 00:16:22 2025 +0100 +++ b/mercurial/interfaces/repository.py Sun Feb 16 01:20:24 2025 +0100 @@ -17,6 +17,7 @@ Iterable, Iterator, Mapping, + Optional, Protocol, Set, ) @@ -29,12 +30,6 @@ ByteString, # TODO: change to Buffer for 3.14 ) - # Almost all mercurial modules are only imported in the type checking phase - # to avoid circular imports - from ..utils import ( - urlutil, - ) - from . import ( dirstate as intdirstate, matcher, @@ -150,7 +145,7 @@ ui: Ui """ui.ui instance""" - path: urlutil.path | None + path: Optional[misc.IPath] """a urlutil.path instance or None""" @abc.abstractmethod @@ -455,13 +450,13 @@ """ limitedarguments: bool = False - path: urlutil.path | None + path: misc.IPath | None ui: Ui def __init__( self, ui: Ui, - path: urlutil.path | None = None, + path: misc.IPath | None = None, remotehidden: bool = False, ) -> None: self.ui = ui