hg-fast-export: add option to track remote branches under a custom namespace
[fast-export.git] / hg-fast-export.txt
blobfea8f60a41687c844cb0999039f963ed64cd971c
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 The current maintainer is Frej Drejhammar <frej.drejhammar@gmail.com>.
13 Usage
14 =====
16 Using hg-fast-export is quite simple for a mercurial repository <repo>:
18   mkdir repo-git # or whatever
19   cd repo-git
20   git init
21   hg-fast-import.sh -r <repo>
23 Incremental imports to track hg repos is supported, too.
25 Using hg-reset it is quite simple within a git repository that is
26 hg-fast-export'ed from mercurial:
28   hg-reset.sh -R <revision>
30 will give hints on which branches need adjustment for starting over
31 again.
33 Notes/Limitations
34 =================
36 hg-fast-import supports multiple branches but only named branches with exaclty
37 one head each. Otherwise commits to the tip of these heads within branch
38 will get flattened into merge commits.
40 As each git-fast-import run creates a new pack file, it may be required
41 to repack the repository quite often for incremental imports (especially
42 when importing a small number of changesets per incremental import).
44 Design
45 ======
47 hg-fast-import.py was designed in a way that doesn't require a 2-pass mechanism
48 or any prior repository analysis: if just feeds what it finds into
49 git-fast-import. This also implies that it heavily relies on strictly
50 linear ordering of changesets from hg, i.e. its append-only storage
51 model so that changesets hg-fast-import already saw never get modified.
53 Todo
54 ====
56 For incremental imports, handling tags needs to be reworked (maybe):
57 Right now we assume that once a tag is created, it stays forever and
58 never changes. However,
60   1) tags in hg may be removed
61   2) tags may change
63 I'm not yet sure how to handle this and how this interferes with
64 non-hg-based tags in git.
66 The same for branches: They may get removed.
68 For one-time conversions, everything is fine.
70 Footnotes
71 =========
73 [0] http://www.opensource.org/licenses/mit-license.php