I have a local Mercurial repository that I am managing using TortoiseHg. Being new to Mercurial, I deleted some compiled files in the bin and obj folder of my project from the local file system. Now the repository is corrupt and gives me the message of missing files in the commit dialog. Verify also fails with the list of missing files.
Here is the tail of the log ...
data/ApplicationServices/bin/Common.DataServices.Oracle.xml.i#56: missing revlog!
56: empty or missing ApplicationServices/bin/Common.DataServices.Oracle.xml
ApplicationServices/bin/Common.DataServices.Oracle.xml#56: 01e844a32962 in manifests not found
data/ApplicationServices/bin/Common.DataServices.xml.i#56: missing revlog!
56: empty or missing ApplicationServices/bin/Common.DataServices.xml
ApplicationServices/bin/Common.DataServices.xml#56: baa0e6eb9bca in manifests not found
data/ApplicationServices/bin/Common.Entities.xml.i#56: missing revlog!
56: empty or missing ApplicationServices/bin/Common.Entities.xml
ApplicationServices/bin/Common.Entities.xml#56: 1e7cf00250c0 in manifests not found
data/ApplicationServices/obj/Debug/ApplicationServices.csproj.FileListAbsolute.txt.i#56: missing revlog!
56: empty or missing ApplicationServices/obj/Debug/ApplicationServices.csproj.FileListAbsolute.txt
ApplicationServices/obj/Debug/ApplicationServices.csproj.FileListAbsolute.txt#56: fd28009f3e6e in manifests not found
data/Entities/obj/Debug/Entities.csproj.FileListAbsolute.txt.i#56: missing revlog!
56: empty or missing Entities/obj/Debug/Entities.csproj.FileListAbsolute.txt
Entities/obj/Debug/Entities.csproj.FileListAbsolute.txt#56: e2ba293498ed in manifests not found
Entities/obj/Debug/Entities.csproj.FileListAbsolute.txt#60: dd903e8946a9 in manifests not found
Entities/obj/Debug/Entities.csproj.FileListAbsolute.txt#61: 7d60f0cd952f in manifests not found
data/UnitTests/obj/Debug/UnitTests.csproj.FileListAbsolute.txt.i#56: missing revlog!
56: empty or missing UnitTests/obj/Debug/UnitTests.csproj.FileListAbsolute.txt
UnitTests/obj/Debug/UnitTests.csproj.FileListAbsolute.txt#56: c0c8cbccba02 in manifests not found
3999 files, 62 changesets, 5710 total revisions
1266 integrity errors encountered!
Any chance of removing the missing files from the repository?
Thanks
Related
I'm trying to pull from an hg repo but I seem to be getting the following error:
pulling from http://hg.mozilla.org/qa/mozmill-tests
searching for changes
adding changesets
adding manifests
adding file changes
transaction abort!
rollback completed
abort: data/tests/endurance/testBookmarks_AddAndRemoveBookmarkViaAwesomeBar/test1.js.i#2daf2ef33d4b: unknown parent!
And hg verify seems to return
759 files, 2820 changesets, 5082 total revisions
2688 integrity errors encountered!
(first damaged changeset appears to be 54)
How can I fix this?
I've cloned this repo and it worked ok. Do you have any local modifications in your clone? If not, you could just reclone the repo. Otherwise I suggest you to refer to the wiki page about repo corruption.
I just did hg pull on a repository and brought in some changesets. It said to run hg update, so I did. Unfortunately, when I did that, it failed with the following error message:
abort: integrity check failed on 00manifest.i:173!
When I run hg verify, it tells me there are a number of issues with things not in the manifest (with some slight path obscuring):
>hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
somewhere1/file1.aspx#172: in changeset but not in manifest
somewhere2/file1.pdf#170: in changeset but not in manifest checking files
file3.csproj#172: ee005cae8058 not in manifests
somewhere2/file1.pdf#171: 00371c8b9d95 not in manifests
somewhere3/file1.ascx#170: 5c921d9bf620 not in manifests
somewhere4/file1.ascx#172: 23acbd0efd3a not in manifests
somewhere5/file1.aspx#170: ce48ed795067 not in manifests
somewhere5/file2.aspx#171: 15d13df4206f not in manifests
1328 files, 174 changesets, 3182 total revisions
8 integrity errors encountered!
(first damaged changeset appears to be 170)
The source repository passes hg verify just fine.
Is there any way to recover from an integrity check failure or do I need to re-clone the repository completely from the source (not a huge issue in this case)? What could I have done to cause this, so I don't do it again?
Well, since the first damaged changeset is 170, you could clone your local repository to 169 and then pull from the source. That means only pulling 5 changesets.
hg clone -r 169 damagedrepo fixedrepo
cd fixedreop
hg verify
And then:
hg pull originalsource
As for manual recovery of repository corruption, this page expounds on that better than I can. See section 4:
I have found corruption once in a while before, and although the above
documentation says it is usually from user error, my instances were on
removable USB drives with empty working directories. Sometimes things
just don't get written correctly or are interfered with somehow: it's
not always user error. But I always have multiple copies I can reclone
from so I've been able to get away with basic fixing.
If the simple fix of a partial local clone and pulling from the server doesn't fix it, you're down to 2 options after backing up your changes (if any) to a bundle or patches:
Manually hacking at Mercurial's files.
Doing a new full clone from the server. Usually the easier and faster of the two.
Beware: This method will change all hashes.
Actually there is another way to recover the repository when it is corrupted like this -
You can do a complete rebuild of the repository by using the convert extension. See Section 4.5 on https://www.mercurial-scm.org/wiki/RepositoryCorruption#Recovery_using_convert_extension
First enable the convert extension by adding the following to your ~/.hgrc file
[extensions]
convert=
Then convert the bad repo to create a fixed repo:
$ hg convert --config convert.hg.ignoreerrors=True REPO REPOFIX
This worked for me when I had the experience of suddenly finding that there were missing files in the manifests - "error 255".
Try remove your file 00manifest.i from repo and next use hg remove 00manifest.i and hg commit commands. Worked for me.
What we ended up doing was making a new copy of our 'central' repository, deleting the .hg folder in this copy, creating a new repository there (hg init), and then working with this as the central repository.
Be aware however this is only an appropriate solution if you don't need your changeset history other than as a reference (which we don't). You can still use your old central repository for this purpose.
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]
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.
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.
I have a strange problem with updating Mercurial. Everytime when I add a file to my repository and then update another location of the repository (for example with in CI process), the error "no match found" occures. Then when I remove to whole folder and clone it again there are no problems and the new added file(s) are there. Updating and removing doesnt give problems
When I do "a" Verify the following is shown:
data/test.txt.i#54: missing revlog!
54: empty or missing test.txt
test.txt#54: b80de5d13875 in manifests
not found 3 integrity errors
encountered! (first damaged changeset
appears to be 54)
Any idea what could be causing this?
EDIT
The complete trace:
ThoughtWorks.CruiseControl.Core.CruiseControlException:
Source control operation failed:
abort: data/test.txt.i#b80de5d13875:
no match found! . Process command: hg
update --noninteractive at
ThoughtWorks.CruiseControl.Core.Sourcecontrol.ProcessSourceControl.Execute(ProcessInfo
processInfo) at
ThoughtWorks.CruiseControl.Core.Sourcecontrol.Mercurial.Mercurial.GetSource(IIntegrationResult
result) at
ThoughtWorks.CruiseControl.Core.IntegrationRunner.Build(IIntegrationResult
result) at
ThoughtWorks.CruiseControl.Core.IntegrationRunner.Integrate(IntegrationRequest
request)
The "repository corruption" is not patent here, since you can clone again, and retrieve the all content (old and newly added).
So the different points to check are:
1/ process conflict of some kind (something preventing data/test.txt.i#b80de5d13875 to be written, even so the file content is recorded)
2/ hg revlog and hg debugindex, to check out the versions actually recorded in your repo.
3/ hg verify to rule out any repo corruption.
4/ check the integrity of your repo
i think ive managed to corrupt one of mercurial repositories, is there anyway to recover the damage? the message i get when attempting to update the repo to my default branch is:
PS C:\wco\projects\ims\code> hg up -C default
abort: data/Trunk/application/models/priority_model.php.i#83dbdfb60981: no match found!
when i run hg verify, i get the following report:
PS C:\wco\projects\ims\code> hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
data/.buildpath.i#0: missing revlog!
0: empty or missing .buildpath
.buildpath#0: daf15acb5273 in manifests not found
data/.project.i#0: missing revlog!
0: empty or missing .project
.project#0: e8b25997d6d1 in manifests not found
Rawlings IMS/index.html#3: empty or missing copy source revlog index.html:b8b2b36a6eea
Rawlings IMS/index.php#3: empty or missing copy source revlog index.php:a5f76bf232e9
Rawlings IMS/index_backup.php#3: empty or missing copy source revlog index_backup.php:a5f76bf232e9
Rawlings IMS/index_this_hold.html#3: empty or missing copy source revlog index_this_hold.html:b8b2b36a6eea
Rawlings IMS/testera.php#3: empty or missing copy source revlog testera.php:6e9e3666c1bc
Trunk/application/models/priority_model.php#32: 83dbdfb60981 in manifests not found
data/index.html.i#0: missing revlog!
0: empty or missing index.html
index.html#0: b8b2b36a6eea in manifests not found
data/index.php.i#0: missing revlog!
0: empty or missing index.php
index.php#0: a5f76bf232e9 in manifests not found
data/index_backup.php.i#0: missing revlog!
0: empty or missing index_backup.php
index_backup.php#0: a5f76bf232e9 in manifests not found
data/index_this_hold.html.i#0: missing revlog!
0: empty or missing index_this_hold.html
index_this_hold.html#0: b8b2b36a6eea in manifests not found
data/nbproject/project.properties.i#14: missing revlog!
14: empty or missing nbproject/project.properties
nbproject/project.properties#14: 1efa3074378b in manifests not found
data/nbproject/project.xml.i#14: missing revlog!
14: empty or missing nbproject/project.xml
nbproject/project.xml#14: 52689bf2b35a in manifests not found
data/rcrawley/.buildpath.i#9: missing revlog!
9: empty or missing rcrawley/.buildpath
rcrawley/.buildpath#9: 2c6411d4fcff in manifests not found
data/rcrawley/.project.i#9: missing revlog!
9: empty or missing rcrawley/.project
rcrawley/.project#9: cb4b1495acab in manifests not found
data/rcrawley/assets/images/ajax-loader.gif.i#9: missing revlog!
9: empty or missing rcrawley/assets/images/ajax-loader.gif
rcrawley/assets/images/ajax-loader.gif#9: 8ef26516c7da in manifests not found
data/rcrawley/index.html.i#9: missing revlog!
9: empty or missing rcrawley/index.html
rcrawley/index.html#9: 545246299dee in manifests not found
data/rcrawley/index.php.i#9: missing revlog!
9: empty or missing rcrawley/index.php
rcrawley/index.php#9: 66eac798ed6d in manifests not found
data/rcrawley/index_backup.php.i#9: missing revlog!
9: empty or missing rcrawley/index_backup.php
rcrawley/index_backup.php#9: 93971228fbf5 in manifests not found
data/rcrawley/system/index.html.i#9: missing revlog!
9: empty or missing rcrawley/system/index.html
rcrawley/system/index.html#9: 17360d3b566e in manifests not found
data/rcrawley/testera.php.i#9: missing revlog!
9: empty or missing rcrawley/testera.php
rcrawley/testera.php#9: 7d9bd5196740 in manifests not found
data/testera.php.i#0: missing revlog!
0: empty or missing testera.php
testera.php#0: 6e9e3666c1bc in manifests not found
1646 files, 59 changesets, 1897 total revisions
57 integrity errors encountered!
(first damaged changeset appears to be 0)
since the first damaged changeset is 0, this would appear to be pretty terminal. Is there anyway around this?
any help would be appreciated.
hg.ignoreerrors also let missing revlog errors to be ignored when reading the source, which may be useful to fix a repository with a damaged store. Set this option to True and convert from Mercurial to Mercurial.
https://www.mercurial-scm.org/wiki/ConvertExtension
Read this section (trying hg convert).
Your repo appears fried - and post this as a bug report to the Mercurial bug tracker & talk to mpm on the mercurial irc chatroom, he's very helpful.