如何修复包含超长文件路径的mercurial存储库更多260个字符

时间:2012-10-26 09:54:06

标签: windows mercurial

我有mercurial存储库,包含更多260个字符的文件路径。 如果我尝试克隆到Windows机器,我会收到错误。 所以我需要更改存储库中的文件路径,但它无济于事,因为mercurial log存储了具有长路径的旧changset。 如何解决?

1 个答案:

答案 0 :(得分:1)

一种选择是使用ConvertExtension创建一个新的存储库,使用--filemap选项将长路径名重命名为较短的路径名,然后从中进行克隆(请参阅“从Mercurial转换”一节) )。请注意,您需要先在hgrc中启用转换扩展程序。

示例:

创建“filemap.txt”:

rename some/really/long/path/name shorter/path
...

然后:

hg convert --filemap filemap.txt original_repo new_repo
hg clone new_repo [windows_repo]
相关问题