frej / fast-export

A mercurial to git converter using git-fast-import
http://repo.or.cz/w/fast-export.git
808 stars 255 forks source link

Trying to convert repo prompts weird KeyError #235

Closed JustDevZero closed 4 years ago

JustDevZero commented 4 years ago

Trying to convert an error prompts an error:

Command executed with:

hg-fast-export.sh -r /home/zero/Projects/migration/project -A ~/Projects/migration/authors --subrepo-map=/home/zero/Projects/migration/mapping.txt --hg-hash --hgtags

master: Exporting simple delta revision 1935/21890 with 2/492/174 added/changed/removed files Traceback (most recent call last): File "/home/zero/Projects/fast-export/hg-fast-export.py", line 719, in plugins=plugins_dict)) File "/home/zero/Projects/fast-export/hg-fast-export.py", line 571, in hg2git plugins) File "/home/zero/Projects/fast-export/hg-fast-export.py", line 366, in export_commit export_file_contents(ctx,man,added,hgtags,fn_encoding,plugins) File "/home/zero/Projects/fast-export/hg-fast-export.py", line 210, in export_file_contents refresh_gitmodules(ctx) File "/home/zero/Projects/fast-export/hg-fast-export.py", line 196, in refresh_gitmodules gitmodules+=refresh_hg_submodule(name,subrepo_info) File "/home/zero/Projects/fast-export/hg-fast-export.py", line 172, in refresh_hg_submodule gitSha=marks_cache[int(revnum)] KeyError: 10

I understand, that in mapping.txt should be the local relative or absolute path to the subrepo it self, which was converted without errors.

Same error if I remove hg-hash and hgtags.

JustDevZero commented 4 years ago

Looks like is related to another error i've got on the past:

https://github.com/frej/fast-export/issues/171

If I try to map authors on surepo, it fucks up.

Well, no problem, can be skipped.

frej commented 4 years ago

[This is a canned reply to issues that contain too little information for effective troubleshooting]

Please have a look at this blog post about writing effective bug reports. For fast-export you should at least:

JustDevZero commented 4 years ago

Unluckly the code is not public to provide a link.

it appears the problem was caused by subrepo rewriting, so instad of rewriting at the time of conversion, I opted for rewrite the history once it's already on git.