Skip to content

Commit e519c3e

Browse files
committed
Translate 09-git-and-other-scms import-hg v2
1 parent 50ec8f2 commit e519c3e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

book/09-git-and-other-scms/sections/import-hg.asc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
==== Mercurial
22

33
(((Mercurial)))(((Importing, from Mercurial)))
4-
因为 Mercurial 与 Git 在表示版本时有着非常相似的模型,但是因为 Git 更灵活一点,将一个仓库从 Mercurial 转换到 Git 是相当直接的,使用一个叫作“hg-fast-export”的工具,你需要从这里拷贝一份
4+
因为 Mercurial 与 Git 在表示版本时有着非常相似的模型,但是因为 Git 更灵活一点,将一个仓库从 Mercurial 转换到 Git 是相当直接的,使用一个叫作“hg-fast-export”的工具,需要从这里拷贝一份
55

66
[source,console]
77
----
88
$ git clone http://repo.or.cz/r/fast-export.git /tmp/fast-export
99
----
1010

11-
转换的第一步就是要先得到你想要转换的 Mercurial 仓库的完整克隆:
11+
转换的第一步就是要先得到想要转换的 Mercurial 仓库的完整克隆:
1212

1313
[source,console]
1414
----
1515
$ hg clone <remote repo URL> /tmp/hg-repo
1616
----
1717

1818
下一步就是创建一个作者映射文件。
19-
Mercurial 在它放入到变更集作者字段的内容比 Git 更宽容一些,所以这是一个打扫屋子的好机会。
19+
Mercurial 对放入到变更集作者字段的内容比 Git 更宽容一些,所以这是一个打扫屋子的好机会。
2020
生成映射是 `bash` 终端下的一行命令:
2121

2222
[source,console]
@@ -25,7 +25,7 @@ $ cd /tmp/hg-repo
2525
$ hg log | grep user: | sort | uniq | sed 's/user: *//' > ../authors
2626
----
2727

28-
这会花费几秒钟,具体要看你的项目提交历史有多少,最终 `/tmp/authors` 文件看起来会像这样:
28+
这会花费几秒钟,具体要看项目提交历史有多少,最终 `/tmp/authors` 文件看起来会像这样:
2929

3030
[source]
3131
----
@@ -111,7 +111,7 @@ $ git shortlog -sn
111111

112112
那看起来非常好。
113113
所有 Mercurial 标签都已被转换成 Git 标签,Mercurial 分支与书签都被转换成 Git 分支。
114-
现在你已经准备好推送仓库到新的服务器那边
114+
现在已经准备好推送仓库到新的服务器那边
115115

116116
[source,console]
117117
----

0 commit comments

Comments
 (0)