Patchwork D7382: logcmdutil: add a type annotation

login
register
mail settings
Submitter phabricator
Date Nov. 19, 2019, 3:50 a.m.
Message ID <a883baca573252363a27ddbd0bb5d892@localhost.localdomain>
Download mbox | patch
Permalink /patch/43342/
State Not Applicable
Headers show

Comments

phabricator - Nov. 19, 2019, 3:50 a.m.
Closed by commit rHGc9301ac73b95: logcmdutil: add a type annotation (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7382?vs=18098&id=18224

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7382/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7382

AFFECTED FILES
  mercurial/logcmdutil.py

CHANGE DETAILS




To: durin42, #hg-reviewers, dlax, indygreg
Cc: mercurial-devel

Patch

diff --git a/mercurial/logcmdutil.py b/mercurial/logcmdutil.py
--- a/mercurial/logcmdutil.py
+++ b/mercurial/logcmdutil.py
@@ -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.