changeset 1494:249ca10d37f4

Handle empty logs in repo.checksize
author Matt Mackall <mpm@selenic.com>
date Wed, 02 Nov 2005 20:09:19 -0800
parents 1a216cb4ee64
children 1e265c2bec94
files mercurial/revlog.py
diffstat 1 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlog.py	Wed Nov 02 19:26:23 2005 -0800
+++ b/mercurial/revlog.py	Wed Nov 02 20:09:19 2005 -0800
@@ -828,7 +828,14 @@
         expected = 0
         if self.count():
             expected = self.end(self.count() - 1)
-        f = self.opener(self.datafile)
-        f.seek(0, 2)
-        actual = f.tell()
-        return expected - actual
+        try:
+            f = self.opener(self.datafile)
+            f.seek(0, 2)
+            actual = f.tell()
+            return expected - actual
+        except IOError, inst:
+            if inst.errno == errno.ENOENT:
+                return 0
+            raise
+
+