-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathhg2git.txt
57 lines (40 loc) · 1.62 KB
/
hg2git.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
hg2git.(sh|py) - mercurial to git converter using git-fast-import
Legal
=====
The scripts are licensed under the GPL version 2 and were written by
Rocco Rutte <[email protected]> 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
hg2git.sh -r <repo>
Incremental imports to track hg repos is supported, too.
Notes/Limitations
=================
hg2git supports multiple branches but only named branches with exaclty
one head each. Otherwise commits to the tip of these heads within branch
will get flattened into merge commits.
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).
Design
======
hg2git.py was designed in a way that doesn't require a 2-pass mechanism
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
model so that changesets hg2git already saw never get modified.
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.