Unknown parent error in Mercurial but no error in verify - mercurial

We have too large Mercurial repo's in which following error has occured few times during a year when trying to clone:
$ hg clone --rev develop --noupdate http://url.to.repository
adding changesets
adding manifests
adding file changes
transaction abort!
rollback completed
abort: data/.../Result.Database.nuspec.i#03b180f4076b: unknown parent!
All goes well if I don't specify a revision in clone command.
Hg verify doesn't show any error:
$ hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
3427 files, 913 changesets, 5406 total revisions
How can I fix this error?
What is causing this error? I would like to fix the root cause to prevent this happening anymore in future.

Related

hg unshelve: abort: working directory parents do not match unshelve state

I recently tried unshelving a change on Mercurial, and an unshelving rebase conflict occurred, which I ended up resolving. Something went wrong after that, because now when I try to do anything else, I get the following error:
abort: unshelve already in progress
(use 'hg unshelve --continue' or 'hg unshelve --abort')
And when I try to use either of those two options, I get the following:
abort: working directory parents do not match unshelve state
How can I restore my working directory to a usable state?
I deleted .hg/shelvedstate and that fixed it for me. You can also move that file instead i.e. mv .hg/shelvedstate .hg/backupshelvedstate if you want to keep the shelvedstate.

"Unknown Parent" error on rebundle in Mercurial

I accidentally stripped the wrong changesets; however, I saved backups, but when I try to unbundle them using hg unbundle .hg/strip-backup/faa0a1895b97-backup.hg, I get the following error:
adding changesets
transaction abort!
rollback completed
abort: 00changelog.i#561fe01204b5: unknown parent!
What can I do to correct this?
Here's the entire output from hg verify:
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
If unbundle is telling you that it can't apply the bundle then the parent of that "first" changeset it that bundle, the bundles base, doesn't exist in your repo. Since repos never lose changesets using normal mercurial commands (strip isn't normal) then it seem you used strip or some other history-altering-not-normal-usage command to alter or remove that changeset.
Try going through all the .hg/strip-backup/ files and applying them one by one. Maybe one of them does apply and contains the parent the the strip backup you're trying to apply requires.
Tl;Dr: no normal mercurial command ever deletes anything, and the non-normal ones that do create backups. Unless you deleted the file out of band the data is there somewhere.

hg pull abort unknown parent

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.

How can I merge the two heads in Hg now?

I read many posts already, and it seems like none can help.
yeukhon#glasslab:~/hg/graphyte-webclient/webclient/apps$ hg merge
merging .hgignore
merging webclient/codebundle_ldap.log
warning: conflicts during merge.
merging webclient/codebundle_ldap.log failed!
merging webclient/codebundle_lib.log
warning: conflicts during merge.
merging webclient/codebundle_lib.log failed!
merging webclient/graphyte_lib.log
warning: conflicts during merge.
merging webclient/graphyte_lib.log failed!
merging webclient/profile_models.log
warning: conflicts during merge.
merging webclient/profile_models.log failed!
30 files updated, 1 files merged, 0 files removed, 4 files unresolved
use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
I tried this, which marks each as resolved I think
hg resolve -m webclient/profile_models.log
etc
and then update again, but doesn't work. It still tells me
abort: outstanding uncommitted merges
This is my hg summary
yeukhon#glasslab:~/hg/graphyte-webclient/webclient/apps$ hg summary
parent: 106:5082a4f13c33 tip
merged with yeukhon's repo
parent: 96:0e3cfc289a18
Put logs into one directory called logs.
branch: default
commit: 35 modified, 4 unresolved (merge)
update: (current)
MY co-worker pushed one and I just pushed another one. How do I deal with this problem? Thanks.
Those logs are no longer needed. In fact, in my push I removed them because I put them in a directory called "logs".
After resolving the merge, you must do a commit before updating again.
Each time you merge, you must commit before doing anything else. So just do hg commit, give some meaningful commit message and you will be able to continue your job.

Mercurial HG Update Exited With Status 255

When remotely updating a Mercurial Repository, I am getting the following error from the hg update command that is being run on the remote server after the push. I looked around online for some help for this however was unsuccessful in finding anything useful. At this point, I am hoping for some ideas and / or insight as to what would be causing this problem.
The error is just below. It occurred when pushing two changesets. One changeset included an unrelated index.html file change. The other changeset was a merge, which included the index.html change as well as the renaming of the two image files.
levinaris#server01:/home/web/repository$ hg push
pushing to ssh://10.10.1.12//home/web/repository
searching for changes`remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 2 changesets with 1 changes to 1 files
remote: abort: Operation not permitted: /home/web/repository/html/images/image.gif
remote: warning: changegroup hook exited with status 255
Additional details:
Both images are 10385 bytes in size. (yes, this error occurs on two images I have)
The two images had their names changed in changesets that were already pushed and hg updated due to case-folding collisions when attempting to pull the repositories down to Windows PCs.
The target server has the following hook in /etc/mercurial/hgrc:
[hooks]
changegroup = hg update
As a work-around, I did the following:
Deleted image.gif.
Deleted another image file that produced the error.
Ran hg update - success!
Ran hg revert html/image/image.gif
Ran hg revert html/image/otherimage.gif
At this point, I am trying to better understand the cause of this problem, so that I can ensure a solid, easy-to-use implementation in my environment. I really appreciate your help!!
After using hg --debug update in the hook, I received this output:
levinaris#server01:/home/web/repository$ hg push
pushing to /home/web/staging/repository
searching for changes
adding changesets
adding manifests
adding file changes
added 2 changesets with 1 changes to 1 files
resolving manifests
overwrite False partial False
ancestor 58a5edb95c9a local 58a5edb95c9a+ remote 3aafb97b148c
searching for copies back to rev 6
html/index.php: remote is newer -> g
html/images/otherimage.gif.casefolding: update permissions -> e
html/images/image.gif: update permissions -> e
abort: Operation not permitted: /home/web/staging/repository/html/images/image.gif
warning: changegroup hook exited with status 255
Additional Permission Information:
All 3 files in the 2 changesets have 775 permission with the webuser:dev user:group.
My Global hgrc file has the webuser trusted
[trusted]
users = webuser
Is it possible that the permissions that file on the server were such that it couldn't be overwitten by the person doing the push?
If, for example, two different people have done that push (and thus update) the second person isn't going to be able to overwrite the files created by the first person's push triggered update.
Maybe try changing the hook to this for a test (you don't actually have those single quotes on your hook, right?):
[hooks]
changegroup = hg --debug update
If it is a permissions issue the usual fix is to put everyone who will be pushing and updating into the same group (I call mine 'hg') and then using the sticky group bit on all the directories in the repo to make sure new files have that group.