将 Mercurial 项目 (Bitbucket) 切换到 Git (Github)
我正在尝试将我的公共项目从 bitbucket 转移到 github。
我看到 hg-git 扩展将帮助我完成此任务。
$ easy_install hg-git
Searching for hg-git
Best match: hg-git 0.3.0
Processing hg_git-0.3.0-py2.7.egg
hg-git 0.3.0 is already the active version in easy-install.pth
Using /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/hg_git-0.3.0-py2.7.egg
Processing dependencies for hg-git
Searching for dulwich>=0.8.1
为什么?从 dulwich 官方网站我看到 0.8.1 还没有发布。
Reading http://pypi.python.org/simple/dulwich/
Reading http://samba.org/~jelmer/dulwich
Reading http://launchpad.net/dulwich
No local packages or download links found for dulwich>=0.8.1
如果我尝试 github 上提到的更复杂的方式,
我会安装 dulwich 0.8.0
$ which dulwich
/Library/Frameworks/Python.framework/Versions/2.7/bin/dulwich
我克隆 hg -git 存储库并从我的 hgrc 正确链接它。然而,当我尝试使用 hg-git 时,它会抱怨
*** failed to import extension hggit from ~/.bin/hg-git/hggit: No module named dulwich.errors
所以,显然我无法安装 hg-git,并且我被卡住了。
更新
>>> import dulwich
>>> import dulwich.errors
>>> dulwich.errors
<module 'dulwich.errors' from '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dulwich-0.8.0-py2.7-macosx-10.6-intel.egg/dulwich/errors.pyc'>
>>> dulwich
<module 'dulwich' from '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dulwich-0.8.0-py2.7-macosx-10.6-intel.egg/dulwich/__init__.pyc'>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在hg-fast-export .com/articles/converting-from-mercurial-to-git/" rel="nofollow">Dan 的教程
used hg-fast-export following Dan's tutorial
如果可能,请尝试使用 TortoiseHG。它们包括 dulwich 的工作版本,您只需要指定 hg-git 的路径。
If possible, try to use TortoiseHG. They include a working version of dulwich, and you'd only need to specify the path to hg-git.
显然有人两天前刚刚提高了该项目的依赖要求:
https://bitbucket.org /durin42/hg-git/changeset/81f42c0d5ea9
至于你的错误 - 如果你运行
python
并输入会发生什么导入dulwich
,然后导入dulwich.errors
?您收到什么消息?可能由于某种原因,您安装的 dulwich 版本不在 Mercurial 工具使用的模块搜索路径中 - 您可以尝试调整PYTHONPATH
。Apparently someone just bumped the dependency requirement for the project 2 days ago:
https://bitbucket.org/durin42/hg-git/changeset/81f42c0d5ea9
As for your error - what happens if you run
python
and typeimport dulwich
, and thenimport dulwich.errors
? What messages do you get? It may be that for some reason, the version of dulwich you have installed isn't in the module search path being used by Mercurial's tools - you could try adjustingPYTHONPATH
.