Corrupt repository

Greg Ward greg-hg at gerg.ca
Fri Jun 26 07:44:36 CDT 2009


Hi all --

I seem to have a corrupt repository:

$ hg tip
changeset:   8956:af67057f471c
** unknown exception encountered, details follow
** report bug details to http://mercurial.selenic.com/bts/
** or mercurial at selenic.com
** Mercurial Distributed SCM (version 7b3d837ca60e)
** Extensions loaded: qct, alias, hgk, children, graphlog, purge,
convert, record, mq, rebase, patchbomb, extdiff
Traceback (most recent call last):
  File "../hg/hg", line 27, in <module>
    mercurial.dispatch.run()
[...]
  File "/home/greg/src/hg/mercurial/localrepo.py", line 298, in tags
    fnode = self[node].filenode('.hgtags')
  File "/home/greg/src/hg/mercurial/context.py", line 148, in filenode
    return self._fileinfo(path)[0]
  File "/home/greg/src/hg/mercurial/context.py", line 140, in _fileinfo
    node, flag = self._repo.manifest.find(self._changeset[0], path)
  File "/home/greg/src/hg/mercurial/manifest.py", line 98, in find
    text = self.revision(node)
  File "/home/greg/src/hg/mercurial/revlog.py", line 996, in revision
    text = self._chunk(base)
  File "/home/greg/src/hg/mercurial/revlog.py", line 958, in _chunk
    return decompress(self._chunkraw(rev, rev))
  File "/home/greg/src/hg/mercurial/revlog.py", line 108, in decompress
    return _decompress(bin)
zlib.error: Error -3 while decompressing data: incorrect data check

$ hg verify
checking changesets
checking manifests
 8780: reading manifest delta b8195b66e870: Error -3 while
decompressing data: incorrect data check
crosschecking files in changesets and manifests
checking files
 tests/test-backout.out at 8780: a1af28e11331 not in manifests
1247 files, 8957 changesets, 17873 total revisions
2 integrity errors encountered!
(first damaged changeset appears to be 8780)

I get the same crash running 'hg log', but if I use a template that
avoids showing tags... no crash.  And I'm running a recent development
version of hg.  So... is it a bug if Hg crashes on a corrupt
repository?  Or business as usual?

Also, is there any way to recover the repository?  It's no big deal if
I have to throw it away, but I'm curious.  And is there a way to
figure out the source of the corruption: Hg bug or hardware error?

Thanks --

Greg


More information about the Mercurial mailing list