changeset 8716:f3322bb29a0e

dirstate: don't complain about 0-length files
author Matt Mackall <mpm@selenic.com>
date Thu, 04 Jun 2009 16:21:09 -0500
parents 8c667f4c482e
children e8de59577257
files mercurial/dirstate.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Thu Jun 04 16:21:03 2009 -0500
+++ b/mercurial/dirstate.py	Thu Jun 04 16:21:09 2009 -0500
@@ -73,9 +73,10 @@
     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