# HG changeset patch # User Augie Fackler # Date 2019-11-14 03:22:31 # Node ID c9301ac73b95a8a3fd787b2de5d142653680adf4 # Parent a58d2361b2319e86b43c356e3be370dfbd6755c4 logcmdutil: add a type annotation This wasn't actually required in the end, as there was a real bug found by pytype, but the annotation helped me figure that out. We can drop this patch if that's the preference. Differential Revision: https://phab.mercurial-scm.org/D7382 diff --git a/mercurial/logcmdutil.py b/mercurial/logcmdutil.py --- a/mercurial/logcmdutil.py +++ b/mercurial/logcmdutil.py @@ -42,6 +42,16 @@ from .utils import ( ) +if not globals(): + from typing import ( + Any, + Tuple, + ) + + for t in (Any, Tuple): + assert t + + def getlimit(opts): """get the log limit according to option -l/--limit""" limit = opts.get(b'limit') @@ -843,6 +853,7 @@ def _initialrevs(repo, opts): def getrevs(repo, pats, opts): + # type: (Any, Any, Any) -> Tuple[smartset.BaseSet, changesetdiffer] """Return (revs, differ) where revs is a smartset differ is a changesetdiffer with pre-configured file matcher.