Mercurial > public > mercurial-scm > hg
comparison mercurial/revlog.py @ 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 | 46a07392cf28 |
comparison
equal
deleted
inserted
replaced
1493:1a216cb4ee64 | 1494:249ca10d37f4 |
---|---|
826 | 826 |
827 def checksize(self): | 827 def checksize(self): |
828 expected = 0 | 828 expected = 0 |
829 if self.count(): | 829 if self.count(): |
830 expected = self.end(self.count() - 1) | 830 expected = self.end(self.count() - 1) |
831 f = self.opener(self.datafile) | 831 try: |
832 f.seek(0, 2) | 832 f = self.opener(self.datafile) |
833 actual = f.tell() | 833 f.seek(0, 2) |
834 return expected - actual | 834 actual = f.tell() |
835 return expected - actual | |
836 except IOError, inst: | |
837 if inst.errno == errno.ENOENT: | |
838 return 0 | |
839 raise | |
840 | |
841 |