Open tobia opened 8 years ago
I would not oppose such a feature, feel free to submit a patch.
:+1: Hg bookmarks is the right call here
not using HG to begin with is the real answer :D damn unnamed heads!
Here's a workaround to import such a repository.
For each unnamed head, or maybe for each bookmark (hg bookmarks
) create a HG branch with the same name:
hg checkout SomeBookmark
hg branch SomeBookmark
touch .delete_me
hg commit -m SomeBookmark
This should be done on the HG repository before trying to import it into Git. You need to change something and make a commit for the new branch to be visible.
You don't need to add a new commit or a new file. You can amend the commit to change the branch it's on:
hg update SomeBookmark
hg branch SomeBookmark
hg commit --amend -m "$(hg log -r SomeBookmark --template '{desc}')"
The -m
argument is just to copy the commit message from the existing one - if you're interactive you can omit it and just dismiss the editor when it pops up to keep the commit message.
This is a bit cleaner! On the git end it will just look like the branch was always a named branch.
HG bookmarks are effectively the same thing as Git feature branches, while HG branches are a very different beast, much less useful IMHO.
Therefore it would be useful if fast-export converted HG bookmarks → Git branches, instead of failing with an error: