Patchwork D10460: typing: enable pytype processing on mercurial/upgrade_utils/actions.py

login
register
mail settings
Submitter phabricator
Date April 18, 2021, 5:36 a.m.
Message ID <differential-rev-PHID-DREV-c77nipxd6lxwjtkbtfaj-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48777/
State Superseded
Headers show

Comments

phabricator - April 18, 2021, 5:36 a.m.
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This was the suggested workaround for the pytype bug that caused this file to be
  processed forever.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/upgrade_utils/actions.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/upgrade_utils/actions.py b/mercurial/upgrade_utils/actions.py
--- a/mercurial/upgrade_utils/actions.py
+++ b/mercurial/upgrade_utils/actions.py
@@ -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):