将 Mercurial 变更集移植到 hgsubversion 转换后的存储库上
我一直在从颠覆转向反复无常,这造成了一些混乱。我有一个旧的 SVN 服务器(1.4 之前的版本),所以发生的事情如下。
- HgSubversion 不想从主干中提取完整的历史记录,所以我做了一个浅层转换。
- 我的同事对 SVN 做了最后的提交,我把它们拉到了 Hg 中。
- 我们转向 Hg 并开始推动它。
- 为了安全起见,我的一位同事对 SVN 做出了更多承诺。
- 我成功升级了 SVN 服务器并获取了新 SVN 的完整存储库。
- HgSubversion 成功提取了完整的历史记录 - 包括一些额外/重复的提交。
现在我想将浅层 Mercurial 存储库中的提交“移植”到完整的历史记录中,存储库在内容上相关,但在 Mercurial 哈希中无关。除了复制粘贴内容之外,迁移更改的最佳方法是什么?最终每个人都应该能够:
- 切换具有完整历史记录的 Hg 存储库并继续工作
- 作为服务用户,将合适的压缩/重新基础变更集从 Hg 存储库自动推送到 SVN。
我想要一个具有以下场景的具体示例。
- 第 2 步的最后 Mercurial 哈希 - A
- 推送第 3 步后的当前 Mercurial 哈希 - B
- 从升级的 SVN 拉取后最后提交的哈希 - C
- 完整 SVN 历史记录拉取后第 2 步提交的哈希 - D
我不太擅长 ASCII 艺术,感觉免费加一即可获得奖励积分。
I have been migrating from subversion to mercurial piecemeal and this has created a bit of a tangle. I had an old SVN server (pre 1.4) to start with so here is what happened.
- HgSubversion did not want to pull in the full history from trunk, so I did a shallow convert.
- My colleagues did their last commits to SVN and I pulled those into Hg.
- We moved over to Hg and started pushing to it
- Just to be safe one of my colleagues made some more commits to SVN.
- I managed upgrade the SVN server and get the full repo to the new SVN.
- HgSubversion pulled in the full history successfully - including the few extra/duplicate commits.
Now I would like to "transplant" the commits in the shallow mercurial repository into the full history, the repositories are related in content but unrelated in mercurial hashes.Short of just copy pasting content what would be the best way to migrate the changes ? Eventually everybody should be able:
- To switch the Hg repo with full history and keep working
- Have automated push from the Hg repos of suitable squashed/rebased changesets to SVN as a service user.
I would like a concrete example with the following scenario.
- Last mercurial hash at step 2 - A
- Current mercurial hash after pushes step 3 - B
- Hash of last commit after pull from upgraded SVN - C
- Hash of step 2 commit after full SVN history pull - D
I am not very good at ASCII art, feel free to add one for bonus points.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们做了一个 CVS ->上周工作中的水星迁移。就像您的情况一样,有些人继续使用 CVS 一段时间。
为了在 CVS 服务器最终关闭时同步两个存储库,我执行了以下操作:
只有十几个修订版,所以这没什么大不了的...如果您还有更多修改,您也许可以看看移植扩展。
希望这有帮助。
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 :
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.