mercurial/state.py
changeset 38133 dce718404ce6
parent 38127 b7e5c53a779e
child 38145 6f67bfe4b82f
equal deleted inserted replaced
38132:2b8cb0ab231c 38133:dce718404ce6
    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)