mercurial/phases.py
changeset 51285 9d3721552b6c
parent 51124 80bda4254b84
child 51287 f15cb5111a1e
equal deleted inserted replaced
51284:58d39c7865e5 51285:9d3721552b6c
   100 
   100 
   101 """
   101 """
   102 
   102 
   103 
   103 
   104 import struct
   104 import struct
       
   105 import typing
       
   106 
       
   107 from typing import (
       
   108     Any,
       
   109     Callable,
       
   110     Dict,
       
   111     Iterable,
       
   112     List,
       
   113     Optional,
       
   114     Set,
       
   115     Tuple,
       
   116 )
   105 
   117 
   106 from .i18n import _
   118 from .i18n import _
   107 from .node import (
   119 from .node import (
   108     bin,
   120     bin,
   109     hex,
   121     hex,
   118     smartset,
   130     smartset,
   119     txnutil,
   131     txnutil,
   120     util,
   132     util,
   121 )
   133 )
   122 
   134 
   123 if pycompat.TYPE_CHECKING:
   135 # keeps pyflakes happy
   124     from typing import (
   136 assert [
   125         Any,
   137     Any,
   126         Callable,
   138     Callable,
   127         Dict,
   139     Dict,
   128         Iterable,
   140     Iterable,
   129         List,
   141     List,
   130         Optional,
   142     Optional,
   131         Set,
   143     Set,
   132         Tuple,
   144     Tuple,
   133     )
   145 ]
       
   146 
       
   147 Phaseroots = Dict[int, Set[bytes]]
       
   148 
       
   149 if typing.TYPE_CHECKING:
   134     from . import (
   150     from . import (
   135         localrepo,
   151         localrepo,
   136         ui as uimod,
   152         ui as uimod,
   137     )
   153     )
   138 
   154 
   139     Phaseroots = Dict[int, Set[bytes]]
   155     # keeps pyflakes happy
       
   156     assert [uimod]
       
   157 
   140     Phasedefaults = List[
   158     Phasedefaults = List[
   141         Callable[[localrepo.localrepository, Phaseroots], Phaseroots]
   159         Callable[[localrepo.localrepository, Phaseroots], Phaseroots]
   142     ]
   160     ]
   143 
   161 
   144 
   162