mercurial/interfaces/repository.py
changeset 52897 4fa0d89d1bdb
parent 52894 bde94bd8e8a2
child 52902 3e8a3db5f5e8
equal deleted inserted replaced
52896:180591a9a6a1 52897:4fa0d89d1bdb
    15     Callable,
    15     Callable,
    16     Collection,
    16     Collection,
    17     Iterable,
    17     Iterable,
    18     Iterator,
    18     Iterator,
    19     Mapping,
    19     Mapping,
       
    20     Optional,
    20     Protocol,
    21     Protocol,
    21     Set,
    22     Set,
    22 )
    23 )
    23 
    24 
    24 from ..i18n import _
    25 from ..i18n import _
    25 from .. import error
    26 from .. import error
    26 
    27 
    27 if typing.TYPE_CHECKING:
    28 if typing.TYPE_CHECKING:
    28     from typing import (
    29     from typing import (
    29         ByteString,  # TODO: change to Buffer for 3.14
    30         ByteString,  # TODO: change to Buffer for 3.14
    30     )
       
    31 
       
    32     # Almost all mercurial modules are only imported in the type checking phase
       
    33     # to avoid circular imports
       
    34     from ..utils import (
       
    35         urlutil,
       
    36     )
    31     )
    37 
    32 
    38     from . import (
    33     from . import (
    39         dirstate as intdirstate,
    34         dirstate as intdirstate,
    40         matcher,
    35         matcher,
   148     """
   143     """
   149 
   144 
   150     ui: Ui
   145     ui: Ui
   151     """ui.ui instance"""
   146     """ui.ui instance"""
   152 
   147 
   153     path: urlutil.path | None
   148     path: Optional[misc.IPath]
   154     """a urlutil.path instance or None"""
   149     """a urlutil.path instance or None"""
   155 
   150 
   156     @abc.abstractmethod
   151     @abc.abstractmethod
   157     def url(self):
   152     def url(self):
   158         """Returns a URL string representing this peer.
   153         """Returns a URL string representing this peer.
   453 
   448 
   454     All peer instances must conform to this interface.
   449     All peer instances must conform to this interface.
   455     """
   450     """
   456 
   451 
   457     limitedarguments: bool = False
   452     limitedarguments: bool = False
   458     path: urlutil.path | None
   453     path: misc.IPath | None
   459     ui: Ui
   454     ui: Ui
   460 
   455 
   461     def __init__(
   456     def __init__(
   462         self,
   457         self,
   463         ui: Ui,
   458         ui: Ui,
   464         path: urlutil.path | None = None,
   459         path: misc.IPath | None = None,
   465         remotehidden: bool = False,
   460         remotehidden: bool = False,
   466     ) -> None:
   461     ) -> None:
   467         self.ui = ui
   462         self.ui = ui
   468         self.path = path
   463         self.path = path
   469 
   464