equal
deleted
inserted
replaced
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 |