将 Subversion 存储库转换为 Mercurial

发布于 2024-08-09 12:37:07 字数 578 浏览 1 评论 0原文

我正在尝试将 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 技术交流群。

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

发布评论

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

评论(4

半衾梦 2024-08-16 12:37:07

我不知道可能出了什么问题,但我想建议一种解决方法(这是我个人用于此任务的唯一方法!):首先 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!-)

醉生梦死 2024-08-16 12:37:07

尝试使用 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).

未蓝澄海的烟 2024-08-16 12:37:07

我很幸运通过简单地从本地结账转换来解决身份验证问题:

svn co http://myversioncontrorepositoryhere localrepo
hg convert localrepo

I have had luck fixing the authentication problem by simply converting from a local checkout:

svn co http://myversioncontrorepositoryhere localrepo
hg convert localrepo
请远离我 2024-08-16 12:37:07

根据我的经验,对具有大量项目和多年历史的真实 Subversion 存储库进行转换会涉及更多一些。主要是因为在 Subversion 中,拥有一个包含所有内容的大型存储库是很好的。相反,建议 Mercurial 存储库更加细粒度。

我假设以下 Subversion 存储库布局:

├── project1
│   ├── branches
│   ├── tags
│   └── trunk
│       ├── package1
│       └── package2
└── project2

转换应将 package1package2 转换为具有各自历史记录的单独 Mercurial 存储库。在这个答案中,我对单一路径感兴趣,但是标签和分支的转换也是可能的< /a>.

准备工作

我通常在具有快速连接的远程服务器上进行转换。对于 Debian 系列,需要以下软件包。

apt-get install mercurial subversion python-subversion

然后应该启用转换扩展。

echo -e "[extensions]\nhgext.convert=" >> ~/.hgrc

在 Windows 上,请确保您已满足先决条件

执行

请注意,如果您尝试直接从远程 Subversion 存储库进行转换,则可能需要几个小时,因此以下内容将创建项目路径的镜像。那么每次转换只需几秒到几分钟的时间。

cd /tmp
svnadmin create svn-mirror

# on Windows you may need to look at comments to accepted answer
echo '#!/bin/sh' > svn-mirror/hooks/pre-revprop-change
chmod +x svn-mirror/hooks/pre-revprop-change

svnsync init file:///tmp/svn-mirror svn://subversion.repo/project1
svnsync sync file:///tmp/svn-mirror

echo 'include project1/trunk/package1' > package1-map
echo 'rename project1/trunk/package1 .' >> package1-map    
hg convert --filemap=package1-map svn-mirror package1

echo 'include project1/trunk/package2' > package2-map
echo 'rename project1/trunk/package2 .' >> package2-map    
hg convert --filemap=package2-map svn-mirror package2

然后在包目录中,您可以运行 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:

├── project1
│   ├── branches
│   ├── tags
│   └── trunk
│       ├── package1
│       └── package2
└── project2

Conversion should turn package1 and package2 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.

apt-get install mercurial subversion python-subversion

Then Convert extension should be enabled.

echo -e "[extensions]\nhgext.convert=" >> ~/.hgrc

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.

cd /tmp
svnadmin create svn-mirror

# on Windows you may need to look at comments to accepted answer
echo '#!/bin/sh' > svn-mirror/hooks/pre-revprop-change
chmod +x svn-mirror/hooks/pre-revprop-change

svnsync init file:///tmp/svn-mirror svn://subversion.repo/project1
svnsync sync file:///tmp/svn-mirror

echo 'include project1/trunk/package1' > package1-map
echo 'rename project1/trunk/package1 .' >> package1-map    
hg convert --filemap=package1-map svn-mirror package1

echo 'include project1/trunk/package2' > package2-map
echo 'rename project1/trunk/package2 .' >> package2-map    
hg convert --filemap=package2-map svn-mirror package2

Then inside package directory you can run hg serve -p 8080 and clone from http://your.host:8080 with a mercurial client or repo manager like RhodeCode.

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