Mercurial hg 子存储库问题 - “中止:未知修订版”
注意:我昨天在 询问了这个问题kiln.stackexchange.com,但还没有得到答案,这阻碍了我的工作。所以我想我应该在这里尝试一下。
我的主 Mercurial 存储库中有很多子存储库。在初始设置过程中,我在 .hgsub
中犯了一个错误。也就是说,我将两个子存储库指向同一目录。
我应该拥有什么:
sites/1=sites/1
sites/2=sites/2
sites/3=sites/3
我实际上拥有什么:
sites/1=sites/1
sites/2=sites/2
sites/2=sites/3
愚蠢的复制/粘贴错误。我提交了不正确的 .hgsub
,但没有意识到我的错误。经过几次修改后,在向 .hgsub
添加一些新的子存储库时,我注意到了错误并将其修复在 .hgsub
中。我承诺并继续前进。自从我“修复”了 .hgsub
中的错误以来,我已经完成了相当数量的工作,但我不想重做这些工作。
现在我们来讨论实际问题:我在子存储库 sites/3
中进行了一些更改,当我尝试提交主存储库时,出现以下错误:
abort:unknown修订版“LongGUIDLookingString”
我发现此讨论,其中似乎解决了我遇到的同样的问题,但我不太清楚 bos 是如何解决它的。我需要做什么才能解决这个问题?
.hgsubstate
的相关部分:
7d1e430ac5f12e00cb5bebcdf693e72db2c45732 sites/1
6eea936a5b7cfff6169f59d0dc1c8c4eb5f8412d sites/2
e2b83b301997de8add1b659d82a7ab8201bda653 sites/3
Note: I asked this yesterday over at kiln.stackexchange.com, but haven't gotten an answer, and it's holding up my work. So I figured I'd give it a shot here.
My main mercurial repository has a bunch of subrepositories in it. During initial setup, I made a mistake in my .hgsub
. Namely, I pointed two subrepositories to the same directory.
What I should have had:
sites/1=sites/1
sites/2=sites/2
sites/3=sites/3
What I actually had:
sites/1=sites/1
sites/2=sites/2
sites/2=sites/3
Stupid copy/paste error. I committed the incorrect .hgsub
, not realizing my error. A few revisions later, while adding a some new subrespositories to .hgsub
, I noticed the mistake and fixed it inside .hgsub
. I committed and kept rolling along. I've committed a reasonable amount of work that I'd prefer not to redo since I 'fixed' the mistake in .hgsub
.
Now we come to the actual problem: I've made some changes inside the subrepository sites/3
, and when I try to commit the main repository, I get the following error:
abort: unknown revision 'LongGUIDLookingString'
I found this discussion, which seems to address the same problem I'm having, but I can't quite work out how bos fixed it. What do I need to do in order to fix this?
Relevant section of .hgsubstate
:
7d1e430ac5f12e00cb5bebcdf693e72db2c45732 sites/1
6eea936a5b7cfff6169f59d0dc1c8c4eb5f8412d sites/2
e2b83b301997de8add1b659d82a7ab8201bda653 sites/3
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我猜想 .hgsubstate 文件现在包含来自 repo2 条目中的 repo3 的 hashid (这就是您的 LongGUIDLookingString )。
尝试编辑 .hgsubstate 以指向每个存储库的正确/当前 hashid。
如果这不起作用,请粘贴您的 .hgsubstate 文件,以便我们了解如何对其进行调整。
I'd guess the .hgsubstate file now contains a hashid (which is what your LongGUIDLookingString is) from repo3 in the repo2 entry.
Try editing .hgsubstate to point to a correct/present hashid for each repo.
If that doesn't work, please paste i your .hgsubstate file so we can see how it can be tweaked.
对于那些难以提交对
.hgsubstate
更改的人来说,似乎:hg commit -i
不起作用,而hg commit -m
起作用。For those who struggle committing changes to
.hgsubstate
, it appears that:hg commit -i
is not working whilehg commit -m
does.