# HG changeset patch # User Augie Fackler # Date 2019-11-14 03:22:49 # Node ID 127d46468a45d135aa6b296ca88676ae2da4f911 # Parent c9301ac73b95a8a3fd787b2de5d142653680adf4 state: add a pytype annotation Differential Revision: https://phab.mercurial-scm.org/D7383 diff --git a/mercurial/state.py b/mercurial/state.py --- a/mercurial/state.py +++ b/mercurial/state.py @@ -27,6 +27,15 @@ from . import ( ) from .utils import cborutil +if not globals(): + from typing import ( + Any, + Dict, + ) + + for t in (Any, Dict): + assert t + class cmdstate(object): """a wrapper class to store the state of commands like `rebase`, `graft`, @@ -50,6 +59,7 @@ class cmdstate(object): self.fname = fname def read(self): + # type: () -> Dict[bytes, Any] """read the existing state file and return a dict of data stored""" return self._read()