将 Subversion 存储库转换为 Mercurial
我正在尝试将 SVN 存储库转换为 Mercurial,但遇到了一些麻烦。这些是我采取的步骤:(我在 Windows 上)
在扩展中打开“转换”
打开命令窗口,然后键入:
hg convert http://myversioncontrorepositoryhere
它说它正在初始化目标文件夹,然后询问:
Enter username for Administration at http://myversioncontrorepositoryhere:
键入我的用户名,然后
in Administration at http://myversioncontrorepositoryhere:
我假设这是我的密码,但它只是循环回到
Enter username for Administration at http://myversioncontrorepositoryhere:
我做错了什么?我非常确定我输入的用户名和密码正确。
I am trying to convert an SVN repository to Mercurial, but I'm having some troubles. These are the steps I've taken: (I am on Windows)
Turned on "convert" in the extensions
Opened a command window, and typed:
hg convert http://myversioncontrorepositoryhere
It says it's initializing the destination folder and then asks:
Enter username for Administration at http://myversioncontrorepositoryhere:
type my username then
in Administration at http://myversioncontrorepositoryhere:
I assume this is my password, but it just loops back to
Enter username for Administration at http://myversioncontrorepositoryhere:
What am I doing wrong? I'm very sure I'm typing in my username and password correctly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我不知道可能出了什么问题,但我想建议一种解决方法(这是我个人用于此任务的唯一方法!):首先 svnsync svn 项目制作本地镜像,然后
hg Convert
本地镜像镜子——这就是奥沙利文在他的书中所建议的 (这个 URL 作为“书中的示例”,准确地包含将项目从其他 VCS 导入到 hg 的相关附录——特别强调 svn!),尽管他的建议主要是出于对速度的考虑,我怀疑遵循它还省去了我的身份验证和授权麻烦,我希望它也能为您做同样的事情!-)I don't know what may be going wrong, but I'd like to suggest a workaround (which is the only way I've personally used for this task!): first svnsync the svn project to make a local mirror, then
hg convert
that local mirror -- that's what O'Sullivan suggests in his book (this URL has, as "sample from the book", exactly the relevant appendix for importing projects from other VCSs to hg -- with special emphasis on svn!), though his suggestion is mostly inspired by considerations of speed I suspect that following it has also saved me authentication and authorization hassles, and I hope it could do the same for you!-)尝试使用 hgsubversion ;它更加坚固。我在 Windows 上与 Subversion 的 CLI 交互时遇到了很多奇怪的问题(大部分是通过使用 CMD 而不是另一个 shell 来解决的)。
Try hgsubversion instead; it's a lot more robust. I've had a lot of bizarre issues interacting with Subversion's CLI on Windows (mostly resolved by using CMD instead of another shell).
我很幸运通过简单地从本地结账转换来解决身份验证问题:
I have had luck fixing the authentication problem by simply converting from a local checkout:
根据我的经验,对具有大量项目和多年历史的真实 Subversion 存储库进行转换会涉及更多一些。主要是因为在 Subversion 中,拥有一个包含所有内容的大型存储库是很好的。相反,建议 Mercurial 存储库更加细粒度。
我假设以下 Subversion 存储库布局:
转换应将
package1
和package2
转换为具有各自历史记录的单独 Mercurial 存储库。在这个答案中,我对单一路径感兴趣,但是标签和分支的转换也是可能的< /a>.准备工作
我通常在具有快速连接的远程服务器上进行转换。对于 Debian 系列,需要以下软件包。
然后应该启用转换扩展。
在 Windows 上,请确保您已满足先决条件。
执行
请注意,如果您尝试直接从远程 Subversion 存储库进行转换,则可能需要几个小时,因此以下内容将创建项目路径的镜像。那么每次转换只需几秒到几分钟的时间。
然后在包目录中,您可以运行
hgserve -p 8080
并使用 Mercurial 客户端或像 RhodeCode 这样的存储库管理器从http://your.host:8080
进行克隆。In my experience conversion of a real-word Subversion repository with bunch of projects and years of history is a little more involved. Mostly because in Subversion it's fine to have one huge repo for all the stuff. On the contrary Mercurial repositories are advised to be much more fine-grained.
I assume the following Subversion repository layout:
Conversion should turn
package1
andpackage2
into separate Mercurial repositories with their own history. In this answer I'm interested in single path, but conversion of tags and branches is also possible.Preparation
I usually do conversion on a remote server with fast connection. For Debian-family the following packages are required.
Then Convert extension should be enabled.
On Windows make sure you've fulfilled the prerequisites.
Execution
Note, that if you try to do a conversion directly from a remote subversion repo it will likely take hours, so the following creates mirror of the project's path. Then each conversion is a matter of seconds to minutes.
Then inside package directory you can run
hg serve -p 8080
and clone fromhttp://your.host:8080
with a mercurial client or repo manager like RhodeCode.