# HG changeset patch # User Yuya Nishihara # Date 1574175192 -32400 # Node ID 064c9a4ced4aa0d67e016b55082c4a6b60ea802d # Parent 7b14d649af1b81831dbf17156ab7db2ab61854f6 typing: fix return type of logcmdutil.getrevs() Fixes the following errors: Invalid type annotation "'Tuple[smartset.BaseSet, changesetdiffer]'" [invalid-annotation] No attribute 'BaseSet' on module 'mercurial.smartset' getrevs: bad option in return type [bad-return-type] Expected: Tuple[mercurial.smartset.abstractsmartset, changesetdiffer] Actually returned: Tuple[mercurial.smartset.baseset, None] diff -r 7b14d649af1b -r 064c9a4ced4a mercurial/logcmdutil.py --- a/mercurial/logcmdutil.py Tue Nov 19 23:49:05 2019 +0900 +++ b/mercurial/logcmdutil.py Tue Nov 19 23:53:12 2019 +0900 @@ -45,10 +45,11 @@ if pycompat.TYPE_CHECKING: from typing import ( Any, + Optional, Tuple, ) - for t in (Any, Tuple): + for t in (Any, Optional, Tuple): assert t @@ -853,7 +854,7 @@ def getrevs(repo, pats, opts): - # type: (Any, Any, Any) -> Tuple[smartset.BaseSet, changesetdiffer] + # type: (Any, Any, Any) -> Tuple[smartset.abstractsmartset, Optional[changesetdiffer]] """Return (revs, differ) where revs is a smartset differ is a changesetdiffer with pre-configured file matcher.