Mercurial > public > mercurial-scm > hg
comparison mercurial/revlog.py @ 1659:bfa90d9a3b77
Add revlog version signature check
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 29 Jan 2006 20:27:58 +1300 |
parents | 14d1f1868bf6 |
children | b2df93c56ac4 |
comparison
equal
deleted
inserted
replaced
1658:f5e194047f1e | 1659:bfa90d9a3b77 |
---|---|
194 i = self.opener(self.indexfile).read() | 194 i = self.opener(self.indexfile).read() |
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 | |
200 if i[:4] != "\0\0\0\0": | |
201 raise RevlogError(_("incompatible revlog signature on %s") % | |
202 self.indexfile) | |
199 | 203 |
200 if len(i) > 10000: | 204 if len(i) > 10000: |
201 # big index, let's parse it on demand | 205 # big index, let's parse it on demand |
202 parser = lazyparser(i, self) | 206 parser = lazyparser(i, self) |
203 self.index = lazyindex(parser) | 207 self.index = lazyindex(parser) |