1

我一直在从颠覆迁移到反复无常的零碎,这造成了一些混乱。我有一个旧的 SVN 服务器(1.4 之前),所以这就是发生的事情。

  1. HgSubversion 不想从主干中提取完整的历史记录,所以我做了一个浅转换。
  2. 我的同事对 SVN 做了最后一次提交,我把它们拉进了 Hg。
  3. 我们搬到了 Hg 并开始向它推进
  4. 为了安全起见,我的一位同事对 SVN 做了更多的承诺。
  5. 我管理升级了 SVN 服务器并获得了新 SVN 的完整存储库。
  6. HgSubversion 成功提取了完整的历史记录——包括一些额外/重复的提交。

现在我想将浅 mercurial 存储库中的提交“移植”到完整的历史记录中,存储库在内容上是相关的,但在 mercurial 哈希中不相关。除了复制粘贴内容之外,迁移更改的最佳方法是什么?最终每个人都应该能够:

  1. 切换具有完整历史记录的 Hg 存储库并继续工作
  2. 作为服务用户,从 Hg 存储库中自动推送合适的压缩/重新设置变更集到 SVN。

我想要一个具有以下场景的具体示例。

  • 步骤 2 中的最后一个 mercurial 哈希 - A
  • 推动步骤 3 - B 后的当前 mercurial 哈希
  • 从升级的 SVN 拉出后最后一次提交的哈希 - C
  • 完整 SVN 历史拉取后第 2 步提交的哈希 - D

我不是很擅长 ASCII 艺术,随意加一个加分。

4

1 回答 1

2

We did a CVS -> Mercurial migration last week at work. Like in your case, some people continued to use the CVS for a time.

In order to sync the the two repositories when the CVS server was finally shutdown, I did the following :

  1. Convert the CVS to mercurial via cvs2hg
  2. Export each new revision with hg export
  3. Import the patch files with hg patch

There was only a dozen revisions, so this was no big deal... If you have many more revisions, you could maybe take a look at the transplant extension.

Hope this helps.

于 2011-02-25T10:21:46.593 回答