Closed GregWoods closed 5 years ago
Yes that error is due to git requiring that a branch name must be a valid filename or path + filename on the host system. Using the branch map is the correct way to handle it, but there are two potential gotchas:
For historical reasons (before the branch map mechanism was added) fast-export (imperfectly) mangles branch names it thinks won't be valid. I can't remove that functionality and say that maps are what should be used as it would break already existing incremental imports. If you have a branch name that fast-export decides to mangle you'll get a printout of the form Warning: sanitized branch [<unmangled>] to [<mangled>]
. The branch map applies to the branch names before mangling, so that is probably the reason you can't find the troublesome branch in the repo, make sure to remap <unmangled>
and it should work.
Hg allows you to have a branch named a
and another a/b
, something that can't be represented in git as you can't have a file containing the hash of the head of a
in refs/heads/a
and the head of a/b
in the file refs/heads/a/b
in the same file system.
Also consider if you want to use the new -n
-flag from 1181a0af471fe473919b30f476a253a9ae2282b0 from the new v190913 release.
Adding the -n flag to my command line has fixed the issue, Thank you! I would still like to see an example of a valid branch map file, because I couldn't get it to do anything useful. However, this issue as raised, is resolved.
Note: I switched to using Ubuntu 18.04LTS on Windows Subsystem for Linux instead of Git Bash, mostly to get a clean, reproducible environment. It works well.
If it starts working with -n
and an empty map file it's probably due to the automatic mangling, with among other things removes duplicated _
which probably can lead to clashes between two branches.
If you want to test out the branch mapping, run hg branches
and pick a branch name from that list to rename, then run with -n -B <mapfile>
. If that doesn't work, create a new issue for this.
error: cannot lock ref 'refs/heads/VladK_#160_Export_Selected_Question/Question_Transcript"_crashes_if_board_is_empty_(no_questions)': Unable to create 'C:/Projects/magicbullet/.git/refs/heads/VladK_#160_Export_Selected_Question/Question_Transcript"_crashes_if_board_is_empty_(no_questions).lock': Invalid argument
I know from reading around the subject the slashes can be a problem, but the odd double-quote in the middle looks like it could be the problem.
I have tried adding -B argument, where the file contains:
"VladK_#160_Export_Selected_Question/Question_Transcript\"_crashes_if_board_is_empty_(no_questions)"="VladK_#160_Export_Selected_Question__Question_Transcript_crashes_if_board_is_empty_(no_questions)"
Also, I cannot find any reference to this branch in the repository. I asm assuming this is a branch, but maybe it is a tag? The map file doesn't fix the problem.
Any suggestions would be appreciated.