Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix a Mercurial repo that fails updating because points to missing revision in subrepo?

Our mercurial repository gets stuck when trying to update to an old branch which has a subrepo / revision pair that doesn't exist anymore.

abort: unknown revision '22e9bb6a6cd98be85b995f632b2f72d6298f9354'!

Is there any way to tell Mercurial to update to a revision or branch but not attempt to update the subrepos?

like image 432
Pol Avatar asked Oct 30 '11 16:10

Pol


1 Answers

Does the subrepo still exist somewhere else? You can change the pointer to it using the [subpaths] section, which provides a translation layer atop the locations in .hgsub.

If it really doesn't exist anywhere you could so some deep magic like:

hg debugsetparent REVISION_YOU_WANT
cat /dev/null > .hgsub   # put an empty .hgsub in place
hg commit .hgsub
hg update tip

That should create a new revision that's just like REVISION_YOU_WANT except it has an empty .hgsub file, so you can then update to it.

It'd be much better if you could find the subrepo at some new location and point to it with the subpaths.

like image 146
Ry4an Brase Avatar answered Sep 29 '22 22:09

Ry4an Brase