Mercurial > public > mercurial-scm > hg-stable
diff mercurial/logcmdutil.py @ 52755:5c48fd4c0e68
typing: introduce a `types` module and a MatcherT alias
This is a proposal to formalise the way we do typing and do more of it.
The initial motivation to make progress is to help break the 100+ module
cycle that is slowing pytype a lot.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 30 Jan 2025 18:22:01 +0100 |
parents | e627cc25b6f3 |
children |
line wrap: on
line diff
--- a/mercurial/logcmdutil.py Tue Feb 04 14:02:20 2025 -0500 +++ b/mercurial/logcmdutil.py Thu Jan 30 18:22:01 2025 +0100 @@ -22,6 +22,9 @@ ) from .i18n import _ +from .interfaces.types import ( + MatcherT, +) from .node import wdirrev from .thirdparty import attr @@ -1083,9 +1086,7 @@ def makewalker( repo: Any, wopts: walkopts, -) -> Tuple[ - smartset.abstractsmartset, Optional[Callable[[Any], matchmod.basematcher]] -]: +) -> Tuple[smartset.abstractsmartset, Optional[Callable[[Any], MatcherT]]]: """Build (revs, makefilematcher) to scan revision/file history - revs is the smartset to be traversed.