如何将 Mercurial 克隆到 Subversion?
经过多年忍受 subversion(以及 CVS、SourceSafe 和其他;有人还记得 SCCS 吗?),我非常高兴地使用了 bitbucket 和 Mercurial。我现在在本地 hg 存储库中拥有相当多的项目历史记录,每天都会推送到 bitbucket,然后推送到我的家用计算机。
问题是,我的公司希望我在颠覆中保留这段历史的副本。我在尝试设置这个时碰壁了。我已经安装了 hgsubversion,我认为是正确的。我已经使用 svnadmin 创建了一个空的 svn 存储库,准备保存 hg 历史记录。
但现在怎么办?说明说首先要拉出一个克隆(鼻子?那是什么?我认为这意味着签出新的空 svn 目录的副本。好的,做到了。
但现在怎么办?我认为下一步是推送我真正的本地 hg克隆到我刚刚签出的空 svn 存储库,但我尝试过的任何操作都不会执行此操作,如下所示,报告“不相关的存储库”(我记得我将其设置为我的主本地 hg 存储库的 URL 以绕过该操作)我尝试过的所有其他内容都弹出“需要 URL”,
发现新的变更集 139d02f4b233 。 检查 4e97a23b6815:342df9e52cec 中止:存储库不相关 [命令返回代码 255 Mon Apr 25 11:29:33 2011]
所有这些摸索的结果是一个包含 .hg、.svn 和 .hgignore 条目的目录,没有其他内容。
所以,我觉得我错过了一些基本的东西,而其他数百人现在肯定已经尝试过了。有人可以帮我开始吗?谢谢!
PS:目前的目的是永久维护 SVN 作为团队仓库,并定期从 Hg 推送更改,这将无限期地成为我的主要客户。如果这很重要...
I'm a VERY happy user of bitbucket and mercurial after years of putting up with subversion (and CVS, SourceSafe and others; anybody remember SCCS?). I've considerable project history now in my local hg repo, pushed daily to bitbucket and thence to my home machines.
Problem is, my company wants me to maintain a copy of this history in subversion. And I've hit a stone wall trying to set this up. I've installed hgsubversion, I think correctly. And I've used svnadmin to create an empty svn repository ready to hold the hg history.
But now what? The instructions say to start by pulling a clone (of nose? what's that? I assume this means checkout a copy of the new empty svn directory. OK did that.
But now what? I assume the next step is to push my real local hg clone to the empty svn repo I just checked out. But nothing I've tried will do this. Pull fails as follows, reporting "unrelated repository" (as I recall I gate it the URL of my master local hg repo to get around the "Needs a URL" popup on everything else I've tried.
found new changeset 139d02f4b233
examining 4e97a23b6815:342df9e52cec
abort: repository is unrelated
[command returned code 255 Mon Apr 25 11:29:33 2011]
The result of all this fumbling around is a directory with .hg, .svn and .hgignore entries and nothing else.
So, I feel I'm missing something basic that hundreds of others must have tried by now. Can someone please help me get started? Thanks!
PS: Currently the intent is to maintain SVN permanently as the team repo and push changes there from Hg periodically which would remain the main client for me indefinitely. In case this matters...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用转换扩展:
并且 hgsubversion 允许您保持两者同步(双向)
已经在此处回答:
从 Mercurial 转换为 Subversion
从 Mercurial 迁移到 Subversion
You can use the convert extension:
And hgsubversion allows you keep both of them in sync ( bidirectional)
Answered here at SO already:
Converting from Mercurial to Subversion
Migrating from Mercurial to Subversion
也许看看这个问题的答案。
Hgsubversion 用于使用 Hg 从 SVN 克隆的存储库,而不是相反。
Perhaps look at the answers to this question.
Hgsubversion is for working with a repository cloned from SVN using Hg, not the other way around.