fast-export icon indicating copy to clipboard operation
fast-export copied to clipboard

hg2git-mapping changes after each run?

Open emilianbold opened this issue 6 years ago • 1 comments

Hello,

I'm maintaining a Git repository[1] that tracks a Mercurial repository[2] still getting commits.

This works well, except for my 'backup' system: I figured that it might be a good idea to save the hg2git-* files, in case I need to move this incremental conversion over to another machine.

1st question: Do I really need to save hg2git files or can I safely resume the incremental conversion on another machine with less work? (Meaning, are the existing mappings picked-up from the git changeset themselves or something?)

2nd question: hg2git-mapping changes entirely after each run. I would have expected the file to get only some new lines as new commits are converted. But it seems to ordering of lines is random so the diff is huge. Wouldn't it make sense for entires in hg2git-mapping to be sorted or for the file to be append-only somehow?

  1. https://github.com/emilianbold/netbeans-releases
  2. http://hg.netbeans.org/releases/

emilianbold avatar Mar 12 '18 11:03 emilianbold

Hg-fast export is pretty dumb and needs the hg2git-* to know where to continue during incremental imports.

A nice feature of fast-export is that although it needs the hg2git-* files to know where to continue, it (provided branch and author mapping files are unchanged) will always produce the same git repo. So if everything fails and you have to start over from scratch, you can do so and the git hashes will be the same as if you had done an incremental import in multiple steps.

hg2git-mapping is just a dump of a hash table, so fast-export does not care about the order. save_cache in hg2git.py is where the dumping is done, I would not hesitate to merge a patch which sorts the keys before dumping, hint hint...

frej avatar Mar 16 '18 15:03 frej