# HG changeset patch # User Matt Mackall # Date 2009-05-25 17:48:15 # Node ID 8536119f2f94aea7f0de7368341be6f69af3e0c5 # Parent 1323dddf80782ad945b264b5293606d3ca827fc1 dirstate: notice truncated parents read diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -75,6 +75,8 @@ class dirstate(object): st = self._opener("dirstate").read(40) if len(st) == 40: return st[:20], st[20:40] + if len(st) < 40: + raise util.Abort(_('working directory state appears damaged!')) except IOError, err: if err.errno != errno.ENOENT: raise return [nullid, nullid]