equal
deleted
inserted
replaced
58 |
58 |
59 from .utils import ( |
59 from .utils import ( |
60 dateutil, |
60 dateutil, |
61 stringutil, |
61 stringutil, |
62 ) |
62 ) |
|
63 |
|
64 if not globals(): |
|
65 from typing import ( |
|
66 Any, |
|
67 Dict, |
|
68 ) |
|
69 |
|
70 for t in (Any, Dict): |
|
71 assert t |
63 |
72 |
64 stringio = util.stringio |
73 stringio = util.stringio |
65 |
74 |
66 # templates of common command options |
75 # templates of common command options |
67 |
76 |
3957 graftstate.delete() |
3966 graftstate.delete() |
3958 return 0 |
3967 return 0 |
3959 |
3968 |
3960 |
3969 |
3961 def readgraftstate(repo, graftstate): |
3970 def readgraftstate(repo, graftstate): |
|
3971 # type: (Any, statemod.cmdstate) -> Dict[bytes, Any] |
3962 """read the graft state file and return a dict of the data stored in it""" |
3972 """read the graft state file and return a dict of the data stored in it""" |
3963 try: |
3973 try: |
3964 return graftstate.read() |
3974 return graftstate.read() |
3965 except error.CorruptedState: |
3975 except error.CorruptedState: |
3966 nodes = repo.vfs.read(b'graftstate').splitlines() |
3976 nodes = repo.vfs.read(b'graftstate').splitlines() |