--- a/mercurial/interfaces/dirstate.py Tue Feb 04 14:02:20 2025 -0500
+++ b/mercurial/interfaces/dirstate.py Thu Jan 30 18:22:01 2025 +0100
@@ -21,11 +21,13 @@
# Almost all mercurial modules are only imported in the type checking phase
# to avoid circular imports
from .. import (
- match as matchmod,
transaction as txnmod,
)
- from . import status as istatus
+ from . import (
+ matcher,
+ status as istatus,
+ )
# TODO: finish adding type hints
AddParentChangeCallbackT = Callable[
@@ -95,7 +97,7 @@
# TODO: decorate with `@rootcache(b'.hgignore')` like dirstate class?
@property
- def _ignore(self) -> matchmod.basematcher:
+ def _ignore(self) -> matcher.IMatcher:
"""Matcher for ignored files."""
@property
@@ -307,7 +309,7 @@
@abc.abstractmethod
def walk(
self,
- match: matchmod.basematcher,
+ match: matcher.IMatcher,
subrepos: Any, # TODO: figure out what this is
unknown: bool,
ignored: bool,
@@ -327,7 +329,7 @@
@abc.abstractmethod
def status(
self,
- match: matchmod.basematcher,
+ match: matcher.IMatcher,
subrepos: bool,
ignored: bool,
clean: bool,
@@ -352,7 +354,7 @@
# TODO: could return a list, except git.dirstate is a generator
@abc.abstractmethod
- def matches(self, match: matchmod.basematcher) -> Iterable[bytes]:
+ def matches(self, match: matcher.IMatcher) -> Iterable[bytes]:
"""
return files in the dirstate (in whatever state) filtered by match
"""