2007-03-16 18:19:08 +00:00
|
|
|
hg-fast-import.(sh|py) - mercurial to git converter using git-fast-import
|
2007-03-07 15:10:39 +00:00
|
|
|
|
|
|
|
|
Legal
|
|
|
|
|
=====
|
|
|
|
|
|
2007-03-14 10:29:24 +00:00
|
|
|
The scripts are licensed under the MIT license[0] and were written by
|
2007-03-07 15:10:39 +00:00
|
|
|
Rocco Rutte <pdmef@gmx.net> with hints and help from the git list and
|
|
|
|
|
#mercurial on freenode.
|
|
|
|
|
|
|
|
|
|
Usage
|
|
|
|
|
=====
|
|
|
|
|
|
|
|
|
|
Using it is quite simple for a mercurial repository <repo>:
|
|
|
|
|
|
|
|
|
|
mkdir repo-git # or whatever
|
|
|
|
|
cd repo-git
|
|
|
|
|
git init
|
2007-03-16 18:19:08 +00:00
|
|
|
hg-fast-import.sh -r <repo>
|
2007-03-07 15:10:39 +00:00
|
|
|
|
|
|
|
|
Incremental imports to track hg repos is supported, too.
|
|
|
|
|
|
2007-03-13 15:27:29 +00:00
|
|
|
Notes/Limitations
|
|
|
|
|
=================
|
|
|
|
|
|
2007-03-16 18:19:08 +00:00
|
|
|
hg-fast-import supports multiple branches but only named branches with exaclty
|
2007-03-13 15:27:29 +00:00
|
|
|
one head each. Otherwise commits to the tip of these heads within branch
|
|
|
|
|
will get flattened into merge commits.
|
2007-03-07 15:10:39 +00:00
|
|
|
|
2007-03-08 09:37:23 +00:00
|
|
|
As each git-fast-import run creates a new pack file, it may be required
|
|
|
|
|
to repack the repository quite often for incremental imports (especially
|
|
|
|
|
when importing a small number of changesets per incremental import).
|
2007-03-08 09:37:41 +00:00
|
|
|
|
|
|
|
|
Design
|
|
|
|
|
======
|
|
|
|
|
|
2007-03-16 18:19:08 +00:00
|
|
|
hg-fast-import.py was designed in a way that doesn't require a 2-pass mechanism
|
2007-03-08 09:37:41 +00:00
|
|
|
or any prior repository analysis: if just feeds what it finds into
|
|
|
|
|
git-fast-import. This also implies that it heavily relies on strictly
|
|
|
|
|
linear ordering of changesets from hg, i.e. its append-only storage
|
2007-03-16 18:19:08 +00:00
|
|
|
model so that changesets hg-fast-import already saw never get modified.
|
2007-03-08 10:12:01 +00:00
|
|
|
|
2007-03-08 11:46:41 +00:00
|
|
|
Todo
|
|
|
|
|
====
|
|
|
|
|
|
|
|
|
|
For incremental imports, handling tags needs to be reworked (maybe):
|
|
|
|
|
Right now we assume that once a tag is created, it stays forever and
|
|
|
|
|
never changes. However,
|
|
|
|
|
|
|
|
|
|
1) tags in hg may be removed
|
|
|
|
|
2) tags may change
|
|
|
|
|
|
|
|
|
|
I'm not yet sure how to handle this and how this interferes with
|
|
|
|
|
non-hg-based tags in git.
|
|
|
|
|
|
|
|
|
|
The same for branches: They may get removed.
|
|
|
|
|
|
|
|
|
|
For one-time conversions, everything is fine.
|
2007-03-14 10:29:24 +00:00
|
|
|
|
|
|
|
|
Footnotes
|
|
|
|
|
=========
|
|
|
|
|
|
|
|
|
|
[0] http://www.opensource.org/licenses/mit-license.php
|