将 Mercurial 项目 (Bitbucket) 切换到 Git (Github)

发布于 2024-12-04 07:06:44 字数 1851 浏览 1 评论 0 原文

我正在尝试将我的公共项目从 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'>

I am trying to move my public projects from bitbucket to github.

I see that hg-git extension will help me get this done.

$ 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

why? from dulwich official website I see that 0.8.1 is not even out yet.

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

If I try the more involved way as mentioned on github

I get dulwich 0.8.0 installed

$ which dulwich                                                                                 
/Library/Frameworks/Python.framework/Versions/2.7/bin/dulwich

I clone the hg-git repository and properly link it from my hgrc. However when I try using hg-git it complains

*** failed to import extension hggit from ~/.bin/hg-git/hggit: No module named dulwich.errors

So, apparantly I am not able to install hg-git, and I am stuck.


UPDATE

>>> 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 技术交流群。

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

发布评论

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

评论(3

惟欲睡 2024-12-11 07:06:44

hg-fast-export .com/articles/converting-from-mercurial-to-git/" rel="nofollow">Dan 的教程

伪心 2024-12-11 07:06:44

如果可能,请尝试使用 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.

懒的傷心 2024-12-11 07:06:44

显然有人两天前刚刚提高了该项目的依赖要求:

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 type import dulwich, and then import 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 adjusting PYTHONPATH.

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