Subversion中的Mercurial:移动,重命名和标记 [英] Mercurial from Subversion: moves, renames and tags
问题描述
我有一个具有以下布局的Subversion存储库:
I have a subversion repo with the following layout:
svnrepo/projectA/trunk
svnrepo/projectA/tags
svnrepo/projectA/branches
svnrepo/projectB/trunk
svnrepo/projectB/tags
svnrepo/projectB/branches
我想转到一个经过修改的版式的商品回购网站:
hgrepo/projectA
hgrepo/projectB
which I would like to move to a mercurial repo with a revised layout:
hgrepo/projectA
hgrepo/projectB
做到这一点的最佳方法是什么?我的一些想法是:
What is the best way of doing this? Some of my thoughts are:
选项1
将Subversion中的路径重新排列(使用svn move)为中间格式:
Rearrange the paths in subversion (using svn move) to an intermediate format:
svnrepo/trunk/projectA
svnrepo/trunk/projectB
svnrepo/tags/projectA
svnrepo/tags/projectB
svnrepo/branches/projectA
svnrepo/branches/projectB
然后在svnrepo/trunk上进行hg转换.这会混淆hg的导入吗?
then hg convert on the svnrepo/trunk. Will this confuse hg importing?
选项2 hg将每个项目/主体转换为单独的hg仓库.然后将它们合并到一个单独的hg仓库中(使用hg init,hg pull -f projectA等).我认为这将丢失第一个导入项目上的分支名称和标签.
Option 2 hg convert each of the projects/trunk into separate hg repos. Then merge them into a single hg repo (using hg init, hg pull -f projectA, etc). I think this will lose the branch names and tags on the first imported project.
推荐答案
在Mercurial中,将不相关的代码库存储在同一存储库中是一个坏主意,因为它会
In Mercurial, storing unrelated codebases in the same repository is a bad idea because it will
- 合并非常复杂.合并将取决于对所有项目所做的更改,而不仅仅是您要合并的项目.
- 造成存储和检出开销-据我所知,Mercurial不支持仅检出存储库的子目录.您必须一次分支所有项目.
- Significantly complicate merging. Merges will depend on changes made to all projects, rather than just the project you're trying to merge.
- Cause storage and checkout overhead -- Mercurial, as far as I know, does not support checking out only subdirectories of a repository. You'd have to branch all projects at once.
解决方案是将您的单个Subversion存储库转换为多个Mercurial存储库.大多数转换工具都支持此功能.
The solution is to convert your single Subversion repository into multiple Mercurial repositories. Most conversion tools support this.
这篇关于Subversion中的Mercurial:移动,重命名和标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!