导入Subversion版本库现在已经很好地形成了,但之前没有很好的形成
问题描述:
我想从a Subversion repository to Mercurial导入源代码。我用它导入了Hg Subversion。问题是,SVN回购的布局是默认的 - trunk
目录,分支在branches
目录等等 - 今天,但它不是那么早。前段时间,该项目的所有目录都是根存储库,因此Hg Subversion无法将branches
目录转换为Mercurial分支,而新的Mercurial存储库仅包含目录branches
和trunk
。导入Subversion版本库现在已经很好地形成了,但之前没有很好的形成
我转换的分支目录到水银分支 “硬办法”:
- 每个分支
b
hg mv branches/$b .
hg rm branches trunk
hg branch $b
hg commint -m "Creating branch $b"
但是,我想知道:有没有更好的方法来做到这一点?你会如何解决这个问题?
答
hgsubversion应该已经自动检测到trunk/tags/branches目录的存在,并完成了智能化的事情。你是不是强迫hgsubversion进入非自动模式来让它不这么做?
答
$ hg help convert
The filemap is a file that allows filtering and remapping of files and
directories. Each line can contain one of the following directives:
include path/to/file-or-dir
exclude path/to/file-or-dir
rename path/to/source path/to/destination <== YOUR CASE
--filemap FILE remap file names using contents of file