# HG changeset patch # User Matt Mackall # Date 2009-06-04 21:21:09 # Node ID f3322bb29a0efbb94f35fbeb8b7a5cff94e2630d # Parent 8c667f4c482eb5266394090a7e5741df50bbd49b dirstate: don't complain about 0-length files diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -73,9 +73,10 @@ class dirstate(object): def _pl(self): try: st = self._opener("dirstate").read(40) - if len(st) == 40: + l = len(st) + if l == 40: return st[:20], st[20:40] - if len(st) < 40: + elif l > 0 and l < 40: raise util.Abort(_('working directory state appears damaged!')) except IOError, err: if err.errno != errno.ENOENT: raise