水银 (?) + SVN互操作
我需要针对以下场景的一些建议:
我的 Uni 小组有一个巨大的 SVN 存储库。我实际上对整个事情的子目录感兴趣(例如/trunk/projects/my_project) - 不知道它是否真的与SVN重要
我将负责这个项目 95% 的提交
我更喜欢使用 DVCS。最好是 Mercurial,因为这是我熟悉的,但我很灵活,以防其他东西更适合工作流程
my_project 中可能会有许多较小的单独子项目。我希望能够单独处理每个项目
流程如下所示:
创建一个新的子项目
hack hack hack(分支等)
当达到相当稳定的状态时,包含到主项目中并推送到 SVN
偶尔,我可能需要进行一些更改从 SVN(即由其他人)进入主项目,甚至子项目。这些都将进入主干,即 SVN 级别上没有分支
,
我所了解的 Mercurial Wiki 页面 在 SVN 级别上没有分支对于 SVN 互操作性,我怀疑 Mercurial 子存储库功能可能会派上用场,但我仍然不确定如何组织整个混乱。
I need some suggestions for the following scenario:
my Uni group has a huge SVN repository. I'm actually interested in a subdir of the whole thing (e.g. say /trunk/projects/my_project) - dunno if it really matters with SVN
I'll be responsible for 95% of the commits to this project
I'd much prefer to use a DVCS. Preferably Mercurial since that's what I'm familiar with, but I'm flexible in case something else fits the workflow better
There will be potentially many smaller individual subprojects within my_project. I want to be able to work on each one individually
The workflow would be something like following:
create a new subproject
hack hack hack (branch etc)
when a reasonably stable state is achieved, include into the main project and push to SVN
occasionally, I might need to pull some changes from SVN (i.e. by other people) into the main project, or even the subprojects. These will all go into trunk, i.e. no branching on the SVN level
I know about the Mercurial Wiki page for SVN interoperability, and I suspect the Mercurial subrepo features might come in handy, but am still not sure how to organize the whole mess.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如 Lucero 所建议的,hgsubversion 是您通常寻找的工具。此外,正如 Lasse 在对 Lucero 的回答的评论中指出的那样,使用 Mercurial 的子存储库功能与 SVN 中处理子存储库或外部存储库的方式发生冲突:Mercurial 使用纯文件来存储有关子存储库的信息,并且 SVN 不会解释此信息。
无论如何,根据您的问题,您似乎不需要使用子存储库功能:只有在您想要跟踪各个子项目之间的相互依赖关系时才需要它。因此,假设您有独立的子项目,只需在 SVN 中的
/trunk/projects/my_project
下为每个项目创建一个目录,并为每个项目单独使用带有 hgsubversion 的 Mercurial。基本信息是,hgsubversion 允许您本地受益于所有 DVCS 功能,但在发布您的作品时,您或多或少会受到 SVN 功能的限制。当使用 SVN 等中央线性系统作为协作中心时,您无法使用与团队协作相关的 DVCS 工作流程。
也许可以使用 SVN 来设计一个(脆弱的)团队工作流程,模仿 DVCS 的某些方面,但我想这比说服您的同事也使用 Mercurial 或简单地向您发送补丁要花费更多的工作。
As Lucero suggests, hgsubversion is the tool you're generally looking for. Also, as Lasse indicates in his comment to Lucero's answer, using Mercurial's subrepository feature conflicts with how sub- or external repositories are handled in SVN: Mercurial uses plain files to store information about subrepositories and this information is not interpretated by SVN.
Anyway, based on your question it seems you may not need to use the subrepository feature: you only need it in case you want to track interdependencies between individual subprojects. So, assuming you have independent subprojects, just create a directory in SVN below
/trunk/projects/my_project
for each project and use Mercurial with hgsubversion for each individually.The basic message is that hgsubversion allows you to locally benefit from all the DVCS features but when publishing your work, you are more or less restricted to the capabilities of SVN. You cannot make use of DVCS workflows concerning team collaboration when using a central and linear system like SVN as the collaboration hub.
Perhaps it possible to design a (fragile) team-workflow with SVN which imitates some DVCS aspects, but I guess this results in more work than convincing your co-workers to either use Mercurial too or to simply send you patches.
看起来 hgsubversion 非常适合您。它允许您拉取和推送到 SVN 存储库,但在本地您有一个 HG 存储库。
It seems like hgsubversion is a perfect fit for you. It lets you pull and push to a SVN repo, but locally you have a HG repo.