comparison mercurial/revlog.py @ 1660:b2df93c56ac4

Fix revlog signature check for empty revlogs
author Matt Mackall <mpm@selenic.com>
date Sun, 29 Jan 2006 20:30:41 +1300
parents bfa90d9a3b77
children daff3ef0de8d
comparison
equal deleted inserted replaced
1659:bfa90d9a3b77 1660:b2df93c56ac4
195 except IOError, inst: 195 except IOError, inst:
196 if inst.errno != errno.ENOENT: 196 if inst.errno != errno.ENOENT:
197 raise 197 raise
198 i = "" 198 i = ""
199 199
200 if i[:4] != "\0\0\0\0": 200 if i and i[:4] != "\0\0\0\0":
201 raise RevlogError(_("incompatible revlog signature on %s") % 201 raise RevlogError(_("incompatible revlog signature on %s") %
202 self.indexfile) 202 self.indexfile)
203 203
204 if len(i) > 10000: 204 if len(i) > 10000:
205 # big index, let's parse it on demand 205 # big index, let's parse it on demand