changeset 47006:e050efe97fbe stable

typing: enable pytype processing on mercurial/upgrade_utils/actions.py This was the suggested workaround for the pytype bug that caused this file to be processed forever. Differential Revision: https://phab.mercurial-scm.org/D10460
author Matt Harbison <matt_harbison@yahoo.com>
date Wed, 14 Apr 2021 09:49:36 -0400
parents 27602e030a1f
children fceccc36873d
files mercurial/upgrade_utils/actions.py
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/upgrade_utils/actions.py	Sun Apr 18 00:56:09 2021 -0400
+++ b/mercurial/upgrade_utils/actions.py	Wed Apr 14 09:49:36 2021 -0400
@@ -5,15 +5,13 @@
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
-# See https://github.com/google/pytype/issues/860
-# pytype: skip-file
-
 from __future__ import absolute_import
 
 from ..i18n import _
 from .. import (
     error,
     localrepo,
+    pycompat,
     requirements,
     revlog,
     util,
@@ -21,6 +19,13 @@
 
 from ..utils import compression
 
+if pycompat.TYPE_CHECKING:
+    from typing import (
+        List,
+        Type,
+    )
+
+
 # list of requirements that request a clone of all revlog if added/removed
 RECLONES_REQUIREMENTS = {
     requirements.GENERALDELTA_REQUIREMENT,
@@ -110,7 +115,7 @@
         return hash(self.name)
 
 
-allformatvariant = []
+allformatvariant = []  # type: List[Type['formatvariant']]
 
 
 def registerformatvariant(cls):