equal
deleted
inserted
replaced
25 error, |
25 error, |
26 util, |
26 util, |
27 ) |
27 ) |
28 from .utils import cborutil |
28 from .utils import cborutil |
29 |
29 |
|
30 if not globals(): |
|
31 from typing import ( |
|
32 Any, |
|
33 Dict, |
|
34 ) |
|
35 |
|
36 for t in (Any, Dict): |
|
37 assert t |
|
38 |
30 |
39 |
31 class cmdstate(object): |
40 class cmdstate(object): |
32 """a wrapper class to store the state of commands like `rebase`, `graft`, |
41 """a wrapper class to store the state of commands like `rebase`, `graft`, |
33 `histedit`, `shelve` etc. Extensions can also use this to write state files. |
42 `histedit`, `shelve` etc. Extensions can also use this to write state files. |
34 |
43 |
48 """ |
57 """ |
49 self._repo = repo |
58 self._repo = repo |
50 self.fname = fname |
59 self.fname = fname |
51 |
60 |
52 def read(self): |
61 def read(self): |
|
62 # type: () -> Dict[bytes, Any] |
53 """read the existing state file and return a dict of data stored""" |
63 """read the existing state file and return a dict of data stored""" |
54 return self._read() |
64 return self._read() |
55 |
65 |
56 def save(self, version, data): |
66 def save(self, version, data): |
57 """write all the state data stored to .hg/<filename> file |
67 """write all the state data stored to .hg/<filename> file |