如何修复由于指向子仓库中缺少修订而无法更新的Mercurial仓库? [英] How to fix a Mercurial repo that fails updating because points to missing revision in subrepo?

查看:74
本文介绍了如何修复由于指向子仓库中缺少修订而无法更新的Mercurial仓库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当尝试更新到具有子存储库/修订对不再存在的旧分支时,我们的Mercurial存储库被卡住了.

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'!

有没有办法告诉Mercurial更新到修订版或分支,但不尝试更新子仓库?

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

推荐答案

子仓库是否仍然存在于其他地方?您可以使用[subpaths]部分更改指向它的指针,该部分在.hgsub中的位置上方提供了一个转换层.

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

这应该创建一个新版本,就像REVISION_YOU_WANT一样,除了它具有一个空的.hgsub文件,以便您可以对其进行更新.

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.

这篇关于如何修复由于指向子仓库中缺少修订而无法更新的Mercurial仓库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆