Mercurial > hg
comparison mercurial/upgrade_utils/actions.py @ 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 | 856820b497fc |
children | f38bf44e077f |
comparison
equal
deleted
inserted
replaced
47005:27602e030a1f | 47006:e050efe97fbe |
---|---|
3 # Copyright (c) 2016-present, Gregory Szorc | 3 # Copyright (c) 2016-present, Gregory Szorc |
4 # | 4 # |
5 # This software may be used and distributed according to the terms of the | 5 # This software may be used and distributed according to the terms of the |
6 # GNU General Public License version 2 or any later version. | 6 # GNU General Public License version 2 or any later version. |
7 | 7 |
8 # See https://github.com/google/pytype/issues/860 | |
9 # pytype: skip-file | |
10 | |
11 from __future__ import absolute_import | 8 from __future__ import absolute_import |
12 | 9 |
13 from ..i18n import _ | 10 from ..i18n import _ |
14 from .. import ( | 11 from .. import ( |
15 error, | 12 error, |
16 localrepo, | 13 localrepo, |
14 pycompat, | |
17 requirements, | 15 requirements, |
18 revlog, | 16 revlog, |
19 util, | 17 util, |
20 ) | 18 ) |
21 | 19 |
22 from ..utils import compression | 20 from ..utils import compression |
21 | |
22 if pycompat.TYPE_CHECKING: | |
23 from typing import ( | |
24 List, | |
25 Type, | |
26 ) | |
27 | |
23 | 28 |
24 # list of requirements that request a clone of all revlog if added/removed | 29 # list of requirements that request a clone of all revlog if added/removed |
25 RECLONES_REQUIREMENTS = { | 30 RECLONES_REQUIREMENTS = { |
26 requirements.GENERALDELTA_REQUIREMENT, | 31 requirements.GENERALDELTA_REQUIREMENT, |
27 requirements.SPARSEREVLOG_REQUIREMENT, | 32 requirements.SPARSEREVLOG_REQUIREMENT, |
108 | 113 |
109 def __hash__(self): | 114 def __hash__(self): |
110 return hash(self.name) | 115 return hash(self.name) |
111 | 116 |
112 | 117 |
113 allformatvariant = [] | 118 allformatvariant = [] # type: List[Type['formatvariant']] |
114 | 119 |
115 | 120 |
116 def registerformatvariant(cls): | 121 def registerformatvariant(cls): |
117 allformatvariant.append(cls) | 122 allformatvariant.append(cls) |
118 return cls | 123 return cls |