views:

51

answers:

1

I have a git repository, which has changes that I am slowly bringing into a mercurial repository. (It's a weird history, and I'm hand checking everything, and just as well that I am).

Currently, I've generating a diff using git diff, and merging it using patch. That had a few problems, so I switched hg import, which has problems of its own.

What's the best way of doing this?

(What errors? The biggest culprits are lost hunks, and hunks that don't merge and need to done manually. I get "bad end of line" occasionally, and patch sometimes reports that the git diff is corrupted.)

+4  A: 

Have you tried using the hg-git extension? With it, you can pretty easily pull from a Git repo, thus converting a Git repo into a Mercurial repo in the process (and, if desired, you can also push back into the Git repo from hg).

mipadi
This works pretty well. Ironically, it doesn't work better than `hg import` on the git diff. I'm guess the problem then must be an error in the patch algorithm (might need to play with the fuzz factor or something).
Paul Biggar