使用 svnsync & 将 SVN 同步到 Mercurial hg 转换 -- 错过 svn:externals?
我已经创建了 SVN 存储库的 Mercurial 镜像(使用本教程: http://oreilly.com/opensource/excerpts/opensource-mercurial/migration-to-mercurial.html)。同步效果很好,但我注意到它没有获取主 SVN 存储库中引用的外部存储库...
我理想情况下希望能够将所有内容作为单个存储库拉入 Mercurial(以及变更集,如果可能的)。
我不确定的是:缺少外部是 svnsync 的限制,还是 hg Convert 的限制?
有什么方法可以强制外部同步到同一个 Mercurial 存储库中吗?
我认为一个好的解决方案是为外部重新设置同步过程。 创建当前hg镜像的fork,并将外部同步到hg镜像fork中。
问题是,外部的主干旨在进入第一个镜像的子文件夹,那么我如何使用转换来复制它?我怀疑我能否告诉转换导入到子文件夹中......
I've created a Mercurial mirror of an SVN repository (using this tutorial: http://oreilly.com/opensource/excerpts/opensource-mercurial/migrating-to-mercurial.html). The sync works great, except I've noticed it's not picking up an external repository that is referenced in the main SVN repo...
I'd ideally like to be able to pull everything as a single repo into Mercurial (along with changesets if possible).
What I'm not sure of is: is the missing external a limitation of svnsync, or a limitation of hg convert?
Is there any way I can force the external to be synced as well, into the same Mercurial repo?
I'm thinking a good solution would be to set up the sync process all over again, for the external.
Create a fork of the current hg mirror, and sync the external into the hg mirror fork.
The catch with that is, the external's trunk is intended to go into a subfolder of the first mirror, so how can I replicate that with convert? I doubt I could tell convert to import into a subfolder...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
svnsync
用于创建 SVN 存储库的镜像。这包括任何svn:externals
属性。因此它一定是hg Convert
的限制。请注意,您实际上并不需要使用 svnsync 创建镜像。本文建议这样做只是因为拥有本地副本可能会加快转换过程。
SVN 存储库通常包含多个松散相关的项目,每个项目都有自己的分支和标签。但 Mercurial 并不是这样工作的:当您进行分支时,您会分支存储库中的所有内容。您应该为 SVN 中的每个项目创建一个单独的 Mercurial 存储库,该存储库具有自己的主干/分支/标签。这种不同的方法很可能是
hg Convert
忽略外部的原因,即使它们位于同一个 SVN 存储库中。Mercurial 中有一个相当于
svn:externals
的东西;它称为“子存储库”。您在项目根目录中拥有一个包含类似内容的.hgsub
文件,而不是拥有一个或多个svn:externals
属性。您应该首先将每个 SVN 项目转换为单独的 Mercurial 存储库,然后将它们与子存储库连接。有关更多详细信息,请参阅子存储库的 Mercurial Wiki 页面。svnsync
is used to create a mirror of a SVN repository. This includes anysvn:externals
properties. Therefore it must be a limitation ofhg convert
.Note that you don't really need to create a mirror with
svnsync
. The article recommends this only because having a local copy might speed up the conversion process.It is common for a SVN repository to contain multiple loosely related projects, each with their own branches and tags. But Mercurial doesn't work that way: when you branch, you branch everything that is in the repository. You should create a separate mercurial repository for each project in SVN that has its own trunk/branches/tags. This different approach is most likely why
hg convert
ignores externals, even if they are in the same SVN repository.There is an equivalent of
svn:externals
in mercurial; it's called "subrepositories". Instead of having one or moresvn:externals
properties, you have a single.hgsub
file with similar content in the root of your project. You should first convert each SVN project to a seperate mercurial repository, and then connect them with subrepositories. See the mercurial wiki page for subrepositories for more details.