问题标签 [fastexport]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
54 浏览

git - 使用非 UTF8 字符将 mercurial 转换为 git

我有很多 mercurial 存储库,我尝试将它们转换为 git repo。我使用了快速导出 https://github.com/frej/fast-export ,一切都很好,但是我的一些 mercurial repo 有带有俄语字母的文件。
这是一个巨大的存储库,大约有 20k 提交和许多分支

在 ubuntu 上看起来像

在 Windows 上看起来很正常

在 docs 文件夹中,我有许多 word、pdf 和其他格式的文档

起初我试图用命令转换

~/mercurial/fast-export/hg-fast-export.sh -r ~/mercurial/Ptk -fe ISO-8859-1 但转换字符后被破坏

接下来我尝试重命名我的仓库中的所有文件 https://serverfault.com/questions/319070/mercurial-convert-filename-encoding

$ hg 清单 --all | python rename.py > rename.txt 输出是

我尝试使用其他解码 cp1252

file -ib docs/*

输出

接下来我尝试使用 tortoisehg https://tortoisehg.bitbucket.io/进行转换

转换字符后被破坏

我不想从我的存储库中删除任何文档,因为不仅 repo 中包含俄语字符的文档,而且我还有包含俄语字符的源文件,不要问为什么 :)

您能给我建议如何将其转换为 git repo 吗?