如何在Windows上从SVN迁移/转换为Mercurial(hg) [英] How to migrate/convert from SVN to Mercurial (hg) on windows

查看:75
本文介绍了如何在Windows上从SVN迁移/转换为Mercurial(hg)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种工具,可将具有历史,标签等内容的两个SVN存储库迁移到Mercurial.

我使用的是TortoiseHg(Windows x32),因此ConvertExtensions被丢弃.有一些有关如何在Linux机器上执行此过程的信息( hgsvn ),但我不知道没有可用的Linux计算机.

我可以在Windows上使用这些Python脚本吗?如果是这样,我该怎么办?或者,我还可以使用哪些其他工具来完成此过程?

基本上,如何将SVN项目转换为Mercurial?

解决方案

我只需要自己解决这个问题.我有一台装有单独Windows服务器的Windows XP计算机,该服务器托管 VisualSVN服务器.

我还安装了 TortoiseHG 以及 bgever 在注释中指出,使用TortoiseHg 2.0,启用convert扩展比以往更容易.正如他所说

使用TortoiseHG 2.0可以做到这一点 简单得多:启动TortoiseHG 从开始"菜单中选择工作台.选择 文件->设置.选择扩展 从列表中.选中转换" 复选框,然后单击确定.而已!不 需要尝试生成配置 档案,然后在档案中搜寻 系统. – bgever 3月11日7:56

</Enable Convert Extension w/ Tortoise Hg 2>

<Enable Convert Extension Manually>

要将存储库从SVN转换为HG,我按照以下步骤操作:

1)打开C:\ Program Files \ TortoiseHg \ Mercurial.ini

编辑

仅供参考-Tortoise Hg已将此文件迁移到

  • XP或更早版本-C:\ Documents and Settings \ USERNAME \ Mercurial.ini
  • Vista或更高版本-C:\ Users \ USERNAME \ Mercurial.ini

该文件将大部分为空,您只需在此处列出要覆盖的内容即可.如果是这样,只需将这两行添加到文件的末尾即可:

[extensions]
convert =

2)搜索以

开头的行

[扩展名]

3)在其下方,您将看到一个关键字列表,每行用分号(;)注释掉了

4)找到显示

的行

; convert =

并删除分号,使其显示为

转换=

</Enable Convert Extension Manually>

5)打开命令提示符,然后导航到要在其中创建新hg文件夹的目录(该过程将在打开命令提示符的目录中创建一个名为yoursvnreponame-hg的新文件夹). /p>

6)使用此命令

hg转换文件:///y:/yoursvnreponame

我发现转换工具可能会在网络存储库中出现问题,因此我不得不将驱动器映射到它,但这对我来说很好.

I'm looking for a tool to migrate a couple of SVN repositories to Mercurial, with history, labels and so on.

I'm using TortoiseHg (Windows x32), so ConvertExtensions are discarded. There's some info on how to do this process on a Linux box (hgsvn), but I don't have a Linux machine available.

Can I use those Python scripts on Windows? If so, what do I need to do it? Or, what other tools can I use to do this process?

Basically, how can I convert an SVN project to Mercurial?

解决方案

I just had to tackle this problem myself. I have a windows XP machine with a separate windows server hosting VisualSVN Server.

I also have TortoiseHG installed as well as the CollabNet Subversion Command-Line Client.

<Enable Convert Extension w/ Tortoise Hg 2>

Many thanks to bgever for pointing out in the comments that with TortoiseHg 2.0, enabling the convert extension is easier than ever. As he says

With TortoiseHG 2.0 this has been made much simpler: Start the TortoiseHG Workbench from the Start menu. Select File --> Settings. Select Extensions from the list. Check the 'convert' checkbox and click OK. That's it! No need to try to generate the config file anymore and search it in the file system. – bgever Mar 11 at 7:56

</Enable Convert Extension w/ Tortoise Hg 2>

<Enable Convert Extension Manually>

To convert a repository from SVN to HG, I followed these steps:

1) Open C:\Program Files\TortoiseHg\Mercurial.ini

EDIT

FYI - Tortoise Hg has migrated this file to

  • XP or older - C:\Documents and Settings\USERNAME\Mercurial.ini
  • Vista or later - C:\Users\USERNAME\Mercurial.ini

That file will be mostly empty and you'll just list what you'd like to override there. If that's what you have, simple add these two lines to the very end of the file:

[extensions]
convert =

2) Search for the line that begins with

[extensions]

3) Below it you'll see a list of keywords, commented out with a semicolon (;) on each line

4) Find the line that says

;convert =

and delete the semicolon so it reads

convert =

</Enable Convert Extension Manually>

5) Open the command prompt and navigate to the directory that you'd like the new hg folder created in (the process will create a new folder called yoursvnreponame-hg in the directory that the command prompt is open to).

6) Use this command

hg convert file:///y:/yoursvnreponame

I found that the convert tool can have problems with networked repositories, so I had to map a drive to it, but this worked just fine for me.

这篇关于如何在Windows上从SVN迁移/转换为Mercurial(hg)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆