使用 svnsync & 将 SVN 同步到 Mercurial hg 转换 -- 错过 svn:externals?

发布于 2024-10-04 04:22:19 字数 581 浏览 8 评论 0原文

我已经创建了 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

迷爱 2024-10-11 04:22:19

缺少外部是 svnsync 的限制还是 hg Convert 的限制?

svnsync 用于创建 SVN 存储库的镜像。这包括任何 svn:externals 属性。因此它一定是hg Convert的限制。

请注意,您实际上并不需要使用 svnsync 创建镜像。本文建议这样做只是因为拥有本地副本可能会加快转换过程。

有什么方法可以强制外部同步到同一个 Mercurial 存储库中吗?

SVN 存储库通常包含多个松散相关的项目,每个项目都有自己的分支和标签。但 Mercurial 并不是这样工作的:当您进行分支时,您会分支存储库中的所有内容。您应该为 SVN 中的每个项目创建一个单独的 Mercurial 存储库,该存储库具有自己的主干/分支/标签。这种不同的方法很可能是 hg Convert 忽略外部的原因,即使它们位于同一个 SVN 存储库中。

Mercurial 中有一个相当于 svn:externals 的东西;它称为“子存储库”。您在项目根目录中拥有一个包含类似内容的 .hgsub 文件,而不是拥有一个或多个 svn:externals 属性。您应该首先将每个 SVN 项目转换为单独的 Mercurial 存储库,然后将它们与子存储库连接。有关更多详细信息,请参阅子存储库的 Mercurial Wiki 页面

is the missing external a limitation of svnsync or a limitation of hg convert?

svnsync is used to create a mirror of a SVN repository. This includes any svn:externals properties. Therefore it must be a limitation of hg 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.

Is there any way I can force the external to be synced as well, into the same Mercurial repo?

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 more svn: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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文