首页 > 解决方案 > 在 Windows 10 中通过“hg-fast-export.sh”将 Hg 迁移到 Git

问题描述

我已经解决了其他常见问题,但似乎可以解决我希望是最后的障碍。我已将 Python 和 hg-fast-export 位置添加到我的路径“C:\Python27”和“C:\fast-Export”

我发出命令$ hg-fast-export.sh -r /c/tmp/hg-repo并得到这个:

/c/fast-export/hg-fast-export.sh: line 198: C:\Python27: Is a directory
git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects:       5000
Total objects:            0 (         0 duplicates                  )
      blobs  :            0 (         0 duplicates          0 deltas of          0 attempts)
      trees  :            0 (         0 duplicates          0 deltas of          0 attempts)
      commits:            0 (         0 duplicates          0 deltas of          0 attempts)
      tags   :            0 (         0 duplicates          0 deltas of          0 attempts)
Total branches:           0 (         0 loads     )
      marks:           1024 (         0 unique    )
      atoms:              0
Memory total:          2360 KiB
       pools:          2048 KiB
     objects:           312 KiB
---------------------------------------------------------------------
pack_report: getpagesize()            =      65536
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit      = 35184372088832
pack_report: pack_used_ctr            =          0
pack_report: pack_mmap_calls          =          0
pack_report: pack_open_windows        =          0 /          0
pack_report: pack_mapped              =          0 /          0
---------------------------------------------------------------------

我在脚本的第 198 行没有找到任何线索。 C:\Python27: Is a directory似乎并不是一个错误,我已经尝试了许多路径的变体。

标签: python-2.7mercurialrepositorygit-for-windows

解决方案


Not sure if this is the correct answer but here is how I fixed it.

I found that I had multiple versions of Python installed on my machine. I had to do was uninstall them all and then install python 2.7.13. Make sure to select the option to set-up environment variables during installation.

Once done it started complaining that it couldn't find the mercurial modules which sit under C:\Python27\Lib\site-packages\. This can be installed from https://www.mercurial-scm.org/release/windows/ make sure you select the ....win-amd64-py2.7.msi file corresponding to your mercurial version.

I had to uninstall mercurial 4.6 and the modules and install 4.7.2 due to sparse-revlog dependency as shown here. https://www.mercurial-scm.org/wiki/MissingRequirement


推荐阅读