Show More
@@ -90,6 +90,7 b' class convert_git(converter_source):' | |||||
90 | message = self.recode(message) |
|
90 | message = self.recode(message) | |
91 | l = c[:end].splitlines() |
|
91 | l = c[:end].splitlines() | |
92 | parents = [] |
|
92 | parents = [] | |
|
93 | author = committer = None | |||
93 | for e in l[1:]: |
|
94 | for e in l[1:]: | |
94 | n, v = e.split(" ", 1) |
|
95 | n, v = e.split(" ", 1) | |
95 | if n == "author": |
|
96 | if n == "author": | |
@@ -104,9 +105,10 b' class convert_git(converter_source):' | |||||
104 | committer = " ".join(p[:-2]) |
|
105 | committer = " ".join(p[:-2]) | |
105 | if committer[0] == "<": committer = committer[1:-1] |
|
106 | if committer[0] == "<": committer = committer[1:-1] | |
106 | committer = self.recode(committer) |
|
107 | committer = self.recode(committer) | |
107 | message += "\ncommitter: %s\n" % committer |
|
|||
108 | if n == "parent": parents.append(v) |
|
108 | if n == "parent": parents.append(v) | |
109 |
|
109 | |||
|
110 | if committer and committer != author: | |||
|
111 | message += "\ncommitter: %s\n" % committer | |||
110 | tzs, tzh, tzm = tz[-5:-4] + "1", tz[-4:-2], tz[-2:] |
|
112 | tzs, tzh, tzm = tz[-5:-4] + "1", tz[-4:-2], tz[-2:] | |
111 | tz = -int(tzs) * (int(tzh) * 3600 + int(tzm)) |
|
113 | tz = -int(tzs) * (int(tzh) * 3600 + int(tzm)) | |
112 | date = tm + " " + str(tz) |
|
114 | date = tm + " " + str(tz) |
@@ -148,4 +148,22 b' hg convert git-repo3 git-repo3-hg' | |||||
148 | cd git-repo3-hg |
|
148 | cd git-repo3-hg | |
149 | hg up -C |
|
149 | hg up -C | |
150 | python -c 'print len(file("b", "rb").read())' |
|
150 | python -c 'print len(file("b", "rb").read())' | |
|
151 | cd .. | |||
151 |
|
152 | |||
|
153 | echo | |||
|
154 | echo '% test author vs committer' | |||
|
155 | mkdir git-repo4 | |||
|
156 | cd git-repo4 | |||
|
157 | git init-db >/dev/null 2>/dev/null | |||
|
158 | echo >> foo | |||
|
159 | git add foo | |||
|
160 | commit -a -m addfoo | |||
|
161 | echo >> foo | |||
|
162 | GIT_AUTHOR_NAME="nottest" | |||
|
163 | commit -a -m addfoo2 | |||
|
164 | cd .. | |||
|
165 | ||||
|
166 | echo '% convert author committer' | |||
|
167 | hg convert git-repo4 git-repo4-hg | |||
|
168 | cd git-repo4-hg | |||
|
169 | hg log -v |
@@ -10,18 +10,16 b' 3 t3' | |||||
10 | 2 t4.1 |
|
10 | 2 t4.1 | |
11 | 1 t4.2 |
|
11 | 1 t4.2 | |
12 | 0 Merge branch other |
|
12 | 0 Merge branch other | |
13 |
changeset: 5: |
|
13 | changeset: 5:c78094926be2 | |
14 | tag: tip |
|
14 | tag: tip | |
15 |
parent: 3: |
|
15 | parent: 3:f5f5cb45432b | |
16 |
parent: 4: |
|
16 | parent: 4:4e174f80c67c | |
17 | user: test <test@example.org> |
|
17 | user: test <test@example.org> | |
18 | date: Mon Jan 01 00:00:15 2007 +0000 |
|
18 | date: Mon Jan 01 00:00:15 2007 +0000 | |
19 | files: a |
|
19 | files: a | |
20 | description: |
|
20 | description: | |
21 | Merge branch other |
|
21 | Merge branch other | |
22 |
|
22 | |||
23 | committer: test <test@example.org> |
|
|||
24 |
|
||||
25 |
|
23 | |||
26 | % full conversion |
|
24 | % full conversion | |
27 | @ 9 "Discard change to foo" files: foo |
|
25 | @ 9 "Discard change to foo" files: foo | |
@@ -98,3 +96,31 b' converting...' | |||||
98 | 0 addbinary |
|
96 | 0 addbinary | |
99 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
97 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
100 | 4096 |
|
98 | 4096 | |
|
99 | ||||
|
100 | % test author vs committer | |||
|
101 | % convert author committer | |||
|
102 | initializing destination git-repo4-hg repository | |||
|
103 | scanning source... | |||
|
104 | sorting... | |||
|
105 | converting... | |||
|
106 | 1 addfoo | |||
|
107 | 0 addfoo2 | |||
|
108 | changeset: 1:d63e967f93da | |||
|
109 | tag: tip | |||
|
110 | user: nottest <test@example.org> | |||
|
111 | date: Mon Jan 01 00:00:21 2007 +0000 | |||
|
112 | files: foo | |||
|
113 | description: | |||
|
114 | addfoo2 | |||
|
115 | ||||
|
116 | committer: test <test@example.org> | |||
|
117 | ||||
|
118 | ||||
|
119 | changeset: 0:0735477b0224 | |||
|
120 | user: test <test@example.org> | |||
|
121 | date: Mon Jan 01 00:00:20 2007 +0000 | |||
|
122 | files: foo | |||
|
123 | description: | |||
|
124 | addfoo | |||
|
125 | ||||
|
126 |
General Comments 0
You need to be logged in to leave comments.
Login now