# HG changeset patch # User Augie Fackler # Date 2019-11-14 03:21:38 # Node ID a58d2361b2319e86b43c356e3be370dfbd6755c4 # Parent 21e05aabef8c2ba59ed6703e0b7a514127294c60 cmdutil: add a pytype annotation to help out some callsites I think we could constrain the values here more than Any, but this lets us move forward with typechecking commands.py. Differential Revision: https://phab.mercurial-scm.org/D7381 diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -61,6 +61,15 @@ from .utils import ( stringutil, ) +if not globals(): + from typing import ( + Any, + Dict, + ) + + for t in (Any, Dict): + assert t + stringio = util.stringio # templates of common command options @@ -3959,6 +3968,7 @@ def abortgraft(ui, repo, graftstate): def readgraftstate(repo, graftstate): + # type: (Any, statemod.cmdstate) -> Dict[bytes, Any] """read the graft state file and return a dict of the data stored in it""" try: return graftstate.read()