# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2018-05-22 21:43:04 # Node ID dce718404ce605687e368fa9f253ea9f60526fe4 # Parent 2b8cb0ab231cbb6077d821404c65c0799e95fda4 state: raise CorruptedState error isntead of ProgrammingError There are old state files which don't have a version number in top of them and hence we have to read them to check whether they are good or not. ProgrammingError is not apt for this case. Thanks to Yuya for suggesting CorruptedState error. Differential Revision: https://phab.mercurial-scm.org/D3644 diff --git a/mercurial/state.py b/mercurial/state.py --- a/mercurial/state.py +++ b/mercurial/state.py @@ -72,8 +72,8 @@ class cmdstate(object): try: int(fp.readline()) except ValueError: - raise error.ProgrammingError("unknown version of state file" - " found") + raise error.CorruptedState("unknown version of state file" + " found") return cbor.load(fp) def delete(self):