在 Mercurial 中使用 Skeleton 进行多个类似项目
我有多个模块,每个模块都在自己的存储库中。 然后是一个框架,其中包含一些对所有客户端通用的基本代码,以及始终包含的一些模块的子存储库。
在新客户端上使用此设置的最佳方式是什么?
我目前遇到的问题是: - 如果我克隆骨架,然后在骨架中添加一些内容并将其推送到服务器,骨架就会更新。
如果我为客户端的每个项目都有一个存储库,在其中克隆骨架,则会发生同样的事情:骨架中的更改被推送到骨架。
现在,我可能可以通过克隆骨架然后立即在骨架中为客户端创建一个新分支来解决这个问题,但我更喜欢它有自己的存储库用于交付到服务器,而不是作为骨架的分支(我想将其用于骨架版本,而不是项目)。
您有什么建议?
I have multiple modules, each in their own repository.
Then there's a skeleton, which has some basic code that's common for all clients, with subrepos of some modules that are always included.
What is the best way to use this set-up on a new client?
The problem I'm currently experiencing is:
- if I clone the skeleton and then add something in the skeleton and push it to the server, the skeleton gets updated.
If I have a repository per project for the client in which I clone the skeleton, the same thing happens: the changes in the skeleton are pushed to the skeleton.
Now, I can probably fix this by cloning the skeleton and then immediately creating a new branch for the client in the skeleton, but I prefer if it has its own repository for the delivery to the server, instead of being a branch of the skeleton (which I want to use for skeleton versions, not projects).
What are your suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我理解正确的话,缺少的信息是您可以在进行克隆后更改默认推送路径。当您运行
以从
sculpture
存储库获取client-a
克隆时,Mercurial 会使用So < 创建
client-a/.hg/hgrc
code>hg Push 现在会将变更集发送到该存储库。您应该在服务器上创建一个新的克隆:然后在您的计算机上对其进行克隆:
对框架代码的更改将不再自动传播到服务器上的框架存储库。
这样做的一个重要缺点是您的所有客户端存储库都将“兼容”,这意味着您可能会意外地执行此
操作:这在
client-a
和client-b
中有效code> 在骨架存储库中共享一个共同的祖先。因此,我只需复制框架文件并将它们重新添加到每个客户端存储库:由于每个客户端的日期和提交消息都不同,因此存储库将变得不相关和
hg如果您尝试混合来自不同客户端的变更集,push
和hg pull
将出错。If I understand you correctly, the missing bit of information is that you can change the default push path after making a clone. When you run
to get a
client-a
clone from theskeleton
repo, then Mercurial createsclient-a/.hg/hgrc
withSo
hg push
will now send changesets to that repository. You should instead make a new clone on the server:and then make a clone of that on your machine:
Changes to the skeleton code will then no longer automatically propagate to the
skeleton
repo on the server.An important down-side of this is that all your client repositories will be "compatible" This means that you can do this by accident:
This works since
client-a
andclient-b
share a common ancestor in theskeleton
repository. For that reason, I would simply copy the skeleton files and adds them anew to each client repository:Since the date and commit message will be different for each client, the repositories will become unrelated and
hg push
andhg pull
will then error out if you try to mix changesets from different clients.