You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this example, the same person (Bob) has created changesets under four different names, one of which actually looks correct, and one of which would be completely invalid for a Git commit.
41
-
Hg-fast-export lets us fix this by adding `={new name and email address}` at the end of every line we want to change, and removing the lines for any usernames that we want to leave alone.
41
+
Hg-fast-export lets us fix this by turning each line into a rule: `"<input>"="<output>"`, mapping an `<input>` to an `<output>`.
42
+
Inside the `<input>` and `<output>` strings, all escape sequences understood by the python `string_escape` encoding are supported.
43
+
If the author mapping file does not contain a matching `<input>`, that author will be sent on to Git unmodified.
42
44
If all the usernames look fine, we won't need this file at all.
43
45
In this example, we want our file to look like this:
"bob jones <bob <AT> company <DOT> com>"="Bob Jones <[email protected]>"
51
53
----
52
54
55
+
The same kind of mapping file can be used to rename branches and tags when the Mercurial name is not allowed by Git.
56
+
53
57
The next step is to create our new Git repository, and run the export script:
54
58
55
59
[source,console]
@@ -59,7 +63,7 @@ $ cd /tmp/converted
59
63
$ /tmp/fast-export/hg-fast-export.sh -r /tmp/hg-repo -A /tmp/authors
60
64
----
61
65
62
-
The `-r` flag tells hg-fast-export where to find the Mercurial repository we want to convert, and the `-A` flag tells it where to find the author-mapping file.
66
+
The `-r` flag tells hg-fast-export where to find the Mercurial repository we want to convert, and the `-A` flag tells it where to find the author-mapping file (branch and tag mapping files are specified by the `-B` and `-T` flags respectively).
63
67
The script parses Mercurial changesets and converts them into a script for Git's "fast-import" feature (which we'll discuss in detail a bit later on).
64
68
This takes a bit (though it's _much_ faster than it would be over the network), and the output is fairly verbose:
0 commit comments