将Mercurial存储库源推到Git存储库时出错

时间:2019-06-01 09:53:13

标签: git mercurial bitbucket

我正在尝试将Hg存储库转换为Git存储库。两者都是私有存储库。

我已按照下面链接中的详细说明进行操作:

http://arr.gr/blog/2011/10/bitbucket-converting-hg-repositories-to-git/

[

第1步:设置存储库 步骤2:安装Mercurial hggit插件 步骤3:将您的代码推送到Git存储库中 步骤4:切换您的本地存储库以使用Git ]

我还安装了先决条件。 hg-git插件并更新了需要转换的存储库的.hgrc文件。

推送存储库时出现错误(hg push [Git repo path])是“异常终止:没有名为选择器的模块!”

我使用了--traceback选项,请在下面找到日志:

E:\BK_Hg\testHg>hg push --traceback https://CJbipin@bitbucket.org/CJbipin/testgit2.git
pushing to https://CJbipin@bitbucket.org/CJbipin/testgit2.git
Traceback (most recent call last):
File "mercurial\scmutil.pyo", line 161, in callcatch
File "mercurial\dispatch.pyo", line 344, in _runcatchfunc
File "mercurial\dispatch.pyo", line 984, in _dispatch
File "mercurial\dispatch.pyo", line 730, in runcommand
File "mercurial\dispatch.pyo", line 992, in _runcommand
File "mercurial\dispatch.pyo", line 981, in <lambda>
File "mercurial\util.pyo", line 1528, in check
File "mercurial\commands.pyo", line 4369, in push
File "E:/hg-git\hggit\util.py", line 60, in inner
File "E:/hg-git\hggit\__init__.py", line 414, in exchangepush
File "E:/hg-git\hggit\git_handler.py", line 405, in push
File "E:/hg-git\hggit\git_handler.py", line 1063, in upload_pack
File "E:/hg-git\hggit\git_handler.py", line 1749, in get_transport_and_path
File "dulwich\client.pyo", line 1330, in __init__
File "dulwich\client.pyo", line 1304, in default_urllib3_manager
File "hgdemandimport\demandimportpy2.pyo", line 167, in _demandimport
File "hgdemandimport\demandimportpy2.pyo", line 41, in _hgextimport
File "urllib3\__init__.pyo", line 8, in <module>
File "hgdemandimport\demandimportpy2.pyo", line 243, in _demandimport
File "hgdemandimport\demandimportpy2.pyo", line 41, in _hgextimport
File "urllib3\connectionpool.pyo", line 29, in <module>
File "hgdemandimport\demandimportpy2.pyo", line 243, in _demandimport
File "hgdemandimport\demandimportpy2.pyo", line 41, in _hgextimport
File "urllib3\connection.pyo", line 39, in <module>
File "hgdemandimport\demandimportpy2.pyo", line 243, in _demandimport
File "hgdemandimport\demandimportpy2.pyo", line 41, in _hgextimport
File "urllib3\util\__init__.pyo", line 3, in <module>
File "hgdemandimport\demandimportpy2.pyo", line 243, in _demandimport
File "hgdemandimport\demandimportpy2.pyo", line 41, in _hgextimport
File "urllib3\util\connection.pyo", line 3, in <module>
File "hgdemandimport\demandimportpy2.pyo", line 243, in _demandimport
File "hgdemandimport\demandimportpy2.pyo", line 41, in _hgextimport
File "urllib3\util\wait.pyo", line 1, in <module>
File "hgdemandimport\demandimportpy2.pyo", line 243, in _demandimport
File "hgdemandimport\demandimportpy2.pyo", line 41, in _hgextimport
ImportError: No module named selectors
abort: No module named selectors!

致谢 Bipin Kumar

1 个答案:

答案 0 :(得分:0)

因为即使在已发布的THG 5.0.2中,捆绑的hg-git窗台也存在相同的问题:

THG 5解决方案的详细步骤,

快速懒惰方式

  • comment in BB's issue下载价格为4.9.1泰铢的完整lib修补程序
  • 通过上述库中的补丁程序版本,在THG的库归档文件中替换dulwich + urllib3
  • 如果克隆尝试git-repo后出现“ urllib3.exceptions.MaxRetryError”错误,则从补丁中删除证书或使用证书

更纯净的方式

  • 解压library.zip
  • 用1.24.1替换urllib3(下载,编译,替换旧的* .pyo)
  • https://github.com/dulwich/dulwich/中最新的内容(最新版本为0.19.11)替换dulwich(下载,编译,替换旧的* .pyo)
  • 我们没有替换hg-git,因为捆绑的hggit包含针对Mercurial 5的最新兼容性修补程序(而dmitriyse的版本还没有)
  • 删除认证
  • 重新打包库