11

I'm receiving a "missing revlog" error when using Mercurial (via TortoiseHg). Does anybody know how to fix this repo?

% hg --repository C:\Source\Project verify --verbose
repository uses revlog format 1
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
data/MyProject.Class.Library.Tests/Part/FileName.cs.orig.i@1: missing revlog!
1: empty or missing MyProject.Class.Library.Tests/Part/FileName.cs.orig
MyProject.Class.Library.Tests/Part/FileName.cs.orig@1: fb25dd9d5f41 in manifests not found
4384 files, 1354 changesets, 12803 total revisions
3 integrity errors encountered!
(first damaged changeset appears to be 1)
[command returned code 1 Wed May 11 13:31:14 2011]
Guy
  • 65,082
  • 97
  • 254
  • 325
  • 5
    It's no help for this time, but there's a good hint as to what caused this. The mercurial `revert` command creates `.orig` files that go in your working directory, but not your repository. If someone accidentally committed one you ended up with one down in your `.hg/data` area. That's fine, but if then someone outside of Mercurial deleted all `.orig` files recursively thinking they'd only be in the working dir they deleted the file down in `.hg/data` too. – Ry4an Brase May 12 '11 at 02:50

2 Answers2

10

You can try to use convert extension with convert.hg.ignoreerrors set to True, as described on the wiki. Keep in mind that this will modify the hashes, and damaged files will probably be lost completely.

Felix Dombek
  • 13,664
  • 17
  • 79
  • 131
Cat Plus Plus
  • 125,936
  • 27
  • 200
  • 224
5

The Mercurial wiki has a page on Repository Corruption. If the solution suggested by @Cat Plus Plus does not work for you, then you may attempt to reconstruct the revlog.

There is a section with step-by-step instructions for reconstructing missing revlogs. However, you must have a copy o the problem file as it existed in the "bad" revision.

In your case, you would need an exact copy of data/MyProject.Class.Library.Tests/Part/FileName.cs.orig as it existed in revision 1 of the repo.

Tim Henigan
  • 60,452
  • 11
  • 85
  • 78