kilork / hg-git-fast-import

A utility to import single and multiple Mercurial repositories to Git.
The Unlicense
9 stars 4 forks source link

Error migrating branches with multiple '/' characters #18

Open JohnPeacockMessageSystems opened 3 years ago

JohnPeacockMessageSystems commented 3 years ago

We unwisely created some branches with nested branch names which do not migrate cleanly to Git, because git stores branches as filesystem paths:

error: cannot lock ref 'refs/tags/archive/feature/MO-488': 'refs/tags/archive/feature/MO-488/MO-489' exists; cannot create 'refs/tags/archive/feature/MO-488'

I am already passing the --fix-wrong-branch-names option, so it's unclear what I can do to move forward. And in fact, the branches in question are all closed, so because I did not pass the --no-clean-closed-branches option should mean these branches are not migrated at all.

Is there a possibility of providing a --branch-map option to enable us to provide alternate mapping for the affected branches? Or some other way to ignore or prune these closed branches before it hits this error state?

kilork commented 3 years ago

It looks like a bug in the --fix-wrong-branch-names option.

You actually can w/a this, you need to use config.toml and specify mapping in [branches] section.

Simple example you can find here:

https://github.com/kilork/hg-git-fast-import/blob/HEAD/examples/single.toml