changeset 38133:dce718404ce6

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
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 23 May 2018 03:13:04 +0530
parents 2b8cb0ab231c
children edacd831afab
files mercurial/state.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/state.py	Tue May 22 11:20:55 2018 -0700
+++ b/mercurial/state.py	Wed May 23 03:13:04 2018 +0530
@@ -72,8 +72,8 @@
             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):