日期:2014-05-20  浏览次数:20750 次

Hg版本库迁移到Git版本库问题
根据网上的一篇教程进行HG到GIT版本库的迁移,但是遇到这样的问题,不知道大家碰到过没?
环境:Windows 7,JDK1.5,Python
网上的教程如下:

Hg版本库迁移到Git版本库
使用 fast-export 可以很容易的实现 Hg 版本库迁移为Git版本库。

fast-export 工具可以从 http://repo.or.cz/w/fast-export.git 获取到。

转换过程:

~/test/ldap_import-hg$ hg tip

修改集: 15:81f8055fafc0

标签: tip

用户: Jiang Xin <worldhello.net AT gmail DOT com>

日期: Thu Oct 22 16:31:03 2009 +0800

摘要: to address is a list; and strip header works if not blank line.



~/test/ldap_import-hg$ mkdir ../ldap_import-git

~/test/ldap_import-hg$ cd ../ldap_import-git



~/test/ldap_import-git$ git init

Initialized empty Git repository in /home/jiangxin/test/ldap_import-git/.git/



~/test/ldap_import-git$ /path-to/hg-fast-export.sh -r ../ldap_import-hg

master: Exporting full revision 1/16 with 1/0/0 added/changed/removed files

...



~/test/ldap_import-git$ git reset HEAD

Unstaged changes after reset:

...



~/test/ldap_import-git$ git co .


在运行到“/path-to/hg-fast-export.sh -r ../ldap_import-hg”命令时,抛出以下错误:

  File "C:/Program Files/Git/hg-fast-export.py", line 6, in <module>
  from mercurial import repo,hg,cmdutil,util,ui,revlog,node
  ImportError: No module named mercurial

搜了Google,没有找到想要的结果,我感觉是mercurial环境没弄好,但是我在命令行窗口打入hg,能够显示hg相关参数。

请求帮助。

------解决方案--------------------
是说你的python没有mercurial库,不是说没有安装 hg命令行工具。