I am trying to migrate a mercurial repo to git while using hg-git. I follow the tutorial here and I stumbled on an issue in the migration step when I push to the git repo. Some branches (who where converted to bookmarks) aren't migrated because they have spaces in their names.
So my solution to that is just to create bookmarks without spaces, I do it with this command (from git bash in win10 x64):
$ hg branches -T {branch}\\n | sed -e 's/.*/"&"/g;p;s/ /_/g;s/"//g' | xargs -d \\n -L 2 sh -c 'hg bookmark -r $0 $1_migrate'
But this fails with the following error:
hg: parse error at 1: unterminated string
("BTSR
^ here)
xargs: sh: exited with status 255; aborting
However, if I replace the bookmark command with echo, the output seems ok:
$ hg branches -T {branch}\\n | sed -e 's/.*/"&"/g;p;s/ /_/g;s/"//g' | xargs -d \\n -L 2 sh -c 'echo $0 $1_migrate'
"BTSR UF2" BTSR_UF2_migrate
So I don't understand what I'm doing wrong here. I must be doing something wrong with xargs I presume, but what?
Thanks in advance