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

混江龙づ霸主 提交于 2019-12-03 17:48:01

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/7946320/how-to-fix-a-mercurial-repo-that-fails-updating-because-points-to-missing-revisi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!