汞栓剂
我有一个关于栓剂的问题。我们的项目设置如下:
+ projectA
+ some files
+ dependencyA
+ some files
dependencyA
是一个子存储库。它是这样创建的:
- cd projectA
- mkdir dependencyA
- cd dependencyA
- hg init
- hg pull ssh://hg@somerandomiphere/dependencyA
- cd ..
- echo dependencyA = ssh://hg@somerandomiphere/dependencyA > .hgsub
- hg add
- hg commit
- hg push
如果我对suprepository进行更改,则从主项目提交并推送它们。由于递归,它们都会被推送到服务器。现在我的同事想从服务器中提取更改。但由于主项目没有任何改变,所以它不起作用。但是如果我更改主项目中的某些内容并将其推送到服务器。在 hg pull
后,他将获得最新的变更集,如果他执行 hg update
,它也会更新子存储库。这是预期的行为。
现在我的问题是,是否有一种方法可以提取更改,但仅用于子存储库而不对其进行新的克隆,或者最好的方法是什么。
I have got a question regarding suprepositories. Our project is set up like this:
+ projectA
+ some files
+ dependencyA
+ some files
dependencyA
is a subrepository. It was created this way:
- cd projectA
- mkdir dependencyA
- cd dependencyA
- hg init
- hg pull ssh://hg@somerandomiphere/dependencyA
- cd ..
- echo dependencyA = ssh://hg@somerandomiphere/dependencyA > .hgsub
- hg add
- hg commit
- hg push
If I make changes to the suprepository, then commit and push them from main project. Both of them will be pushed to the server since its recursive. Now my colleague wants to pull changes from the server. But since nothing was changed in the main project, it wont work. But if I change something in the main project and push it to server. Upon hg pull
he will get the newest changeset and if he does hg update
then, it will update the subrepository as well. This is expected behaviour.
Now my question would be, if there is a way to pull changes, but only for subrepository without making a new clone of it or what would be the best way to do it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Mercurial wiki 中的子存储库,第 14 页2.5“拉动”
Subrepository in Mercurial wiki, p. 2.5 "Pull"
上面建议的效果就像我想象的那样。真正的问题是我创建子存储库的方式。
而不是:
它应该是一个简单的:
正如我们所知
.hgsusbtate< /code> 将在提交后锁定特定修订版的子存储库。这就是发生的事情,但是(!)在子存储库中执行
hg pull
并以错误结束所以这意味着我的子存储库被锁定在提交后更新的修订版上并且它不能 由于上面显示的错误,从其存储库中提取更改。为什么发生这种情况在这个 接受答案。
解决方案:
克隆是出路
What was suggested above works like I thought it would. The real problem was my way of creating a subrepository.
Instead of:
It should have been a simple:
As we know
.hgsusbtate
will lock the subrepo on specific revision after commit. This is what happened, but (!) doinghg pull
in subrepository ended with an errorSo this means my subrepo was locked on the revision it was updated after commit and it could not pull changes from its repository due to the error shown above. Why this happened is explained pretty well in this accepted answer.
Solution:
cloning is the way to go