equal
deleted
inserted
replaced
70 data in the same format as it was before storing""" |
70 data in the same format as it was before storing""" |
71 with self._repo.vfs(self.fname, 'rb') as fp: |
71 with self._repo.vfs(self.fname, 'rb') as fp: |
72 try: |
72 try: |
73 int(fp.readline()) |
73 int(fp.readline()) |
74 except ValueError: |
74 except ValueError: |
75 raise error.ProgrammingError("unknown version of state file" |
75 raise error.CorruptedState("unknown version of state file" |
76 " found") |
76 " found") |
77 return cbor.load(fp) |
77 return cbor.load(fp) |
78 |
78 |
79 def delete(self): |
79 def delete(self): |
80 """drop the state file if exists""" |
80 """drop the state file if exists""" |
81 util.unlinkpath(self._repo.vfs.join(self.fname), ignoremissing=True) |
81 util.unlinkpath(self._repo.vfs.join(self.fname), ignoremissing=True) |