changeset 43701:c9301ac73b95

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
author Augie Fackler <augie@google.com>
date Wed, 13 Nov 2019 22:22:31 -0500
parents a58d2361b231
children 127d46468a45
files mercurial/logcmdutil.py
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/logcmdutil.py	Wed Nov 13 22:21:38 2019 -0500
+++ b/mercurial/logcmdutil.py	Wed Nov 13 22:22:31 2019 -0500
@@ -42,6 +42,16 @@
 )
 
 
+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 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.