diff --git a/mercurial/state.py b/mercurial/state.py --- a/mercurial/state.py +++ b/mercurial/state.py @@ -55,7 +55,11 @@ return self.exists() def __getitem__(self, key): - return self.opts[key] + try: + return self.opts[key] + except KeyError: + raise error.ProgrammingError(_("key '%s' not found in state" + " file %s") % (key, self.path)) def load(self): """load the existing evolvestate file into the class object"""