Mercurial > public > mercurial-scm > hg-stable
diff mercurial/logcmdutil.py @ 51304:f15cb5111a1e
pytype: move some type comment to proper annotation
We support direct type annotations now, while pytype is starting to complains
about them.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 19 Dec 2023 21:29:34 +0100 |
parents | 9d3721552b6c |
children | f4a0806081f2 |
line wrap: on
line diff
--- a/mercurial/logcmdutil.py Wed Dec 20 20:13:22 2023 +0100 +++ b/mercurial/logcmdutil.py Tue Dec 19 21:29:34 2023 +0100 @@ -789,8 +789,11 @@ limit = attr.ib(default=None) -def parseopts(ui, pats, opts): - # type: (Any, Sequence[bytes], Dict[bytes, Any]) -> walkopts +def parseopts( + ui: Any, + pats: Sequence[bytes], + opts: Dict[bytes, Any], +) -> walkopts: """Parse log command options into walkopts The returned walkopts will be passed in to getrevs() or makewalker(). @@ -1080,8 +1083,12 @@ return revs -def makewalker(repo, wopts): - # type: (Any, walkopts) -> Tuple[smartset.abstractsmartset, Optional[Callable[[Any], matchmod.basematcher]]] +def makewalker( + repo: Any, + wopts: walkopts, +) -> Tuple[ + smartset.abstractsmartset, Optional[Callable[[Any], matchmod.basematcher]] +]: """Build (revs, makefilematcher) to scan revision/file history - revs is the smartset to be traversed. @@ -1131,8 +1138,10 @@ return revs, filematcher -def getrevs(repo, wopts): - # type: (Any, walkopts) -> Tuple[smartset.abstractsmartset, Optional[changesetdiffer]] +def getrevs( + repo: Any, + wopts: walkopts, +) -> Tuple[smartset.abstractsmartset, Optional[changesetdiffer]]: """Return (revs, differ) where revs is a smartset differ is a changesetdiffer with pre-configured file matcher.