Improved output for multi branch imports and noted another little todo item
[fast-export.git] / hg-fast-export.txt
blob1b8bb1c02ad88233c8df3e5d8ab6e8485c91c740
1 hg-fast-import.(sh|py) - mercurial to git converter using git-fast-import
3 Legal
4 =====
6 Most hg-* scripts are licensed under the MIT license[0] and were written
7 by Rocco Rutte <pdmef@gmx.net> with hints and help from the git list and
8 #mercurial on freenode. hg-reset.py is licensed under GPLv2 since it
9 copies some code from the mercurial sources.
11 Usage
12 =====
14 Using hg-fast-export is quite simple for a mercurial repository <repo>:
16   mkdir repo-git # or whatever
17   cd repo-git
18   git init
19   hg-fast-import.sh -r <repo>
21 Incremental imports to track hg repos is supported, too.
23 Using hg-reset it is quite simple within a git repository that is
24 hg-fast-export'ed from mercurial:
26   hg-reset.sh -R <revision>
28 will give hints on which branches need adjustment for starting over
29 again.
31 Notes/Limitations
32 =================
34 hg-fast-import supports multiple branches but only named branches with exaclty
35 one head each. Otherwise commits to the tip of these heads within branch
36 will get flattened into merge commits.
38 As each git-fast-import run creates a new pack file, it may be required
39 to repack the repository quite often for incremental imports (especially
40 when importing a small number of changesets per incremental import).
42 Design
43 ======
45 hg-fast-import.py was designed in a way that doesn't require a 2-pass mechanism
46 or any prior repository analysis: if just feeds what it finds into
47 git-fast-import. This also implies that it heavily relies on strictly
48 linear ordering of changesets from hg, i.e. its append-only storage
49 model so that changesets hg-fast-import already saw never get modified.
51 Todo
52 ====
54 For incremental imports, handling tags needs to be reworked (maybe):
55 Right now we assume that once a tag is created, it stays forever and
56 never changes. However,
58   1) tags in hg may be removed
59   2) tags may change
61 I'm not yet sure how to handle this and how this interferes with
62 non-hg-based tags in git.
64 The same for branches: They may get removed.
66 For one-time conversions, everything is fine.
68 Footnotes
69 =========
71 [0] http://www.opensource.org/licenses/mit-license.php