Show More
@@ -188,11 +188,31 b' class convert_git(converter_source):' | |||||
188 | changes = [] |
|
188 | changes = [] | |
189 | seen = set() |
|
189 | seen = set() | |
190 | entry = None |
|
190 | entry = None | |
191 | subexists = False |
|
191 | subexists = [False] | |
192 | subdeleted = False |
|
192 | subdeleted = [False] | |
193 | difftree = fh.read().split('\x00') |
|
193 | difftree = fh.read().split('\x00') | |
194 | lcount = len(difftree) |
|
194 | lcount = len(difftree) | |
195 | i = 0 |
|
195 | i = 0 | |
|
196 | ||||
|
197 | def add(entry, f): | |||
|
198 | seen.add(f) | |||
|
199 | h = entry[3] | |||
|
200 | p = (entry[1] == "100755") | |||
|
201 | s = (entry[1] == "120000") | |||
|
202 | ||||
|
203 | if f == '.gitmodules': | |||
|
204 | subexists[0] = True | |||
|
205 | if entry[4] == 'D': | |||
|
206 | subdeleted[0] = True | |||
|
207 | changes.append(('.hgsub', hex(nullid))) | |||
|
208 | else: | |||
|
209 | changes.append(('.hgsub', '')) | |||
|
210 | elif entry[1] == '160000' or entry[0] == ':160000': | |||
|
211 | subexists[0] = True | |||
|
212 | else: | |||
|
213 | self.modecache[(f, h)] = (p and "x") or (s and "l") or "" | |||
|
214 | changes.append((f, h)) | |||
|
215 | ||||
196 | while i < lcount: |
|
216 | while i < lcount: | |
197 | l = difftree[i] |
|
217 | l = difftree[i] | |
198 | i += 1 |
|
218 | i += 1 | |
@@ -203,29 +223,13 b' class convert_git(converter_source):' | |||||
203 | continue |
|
223 | continue | |
204 | f = l |
|
224 | f = l | |
205 | if f not in seen: |
|
225 | if f not in seen: | |
206 |
|
|
226 | add(entry, f) | |
207 | h = entry[3] |
|
|||
208 | p = (entry[1] == "100755") |
|
|||
209 | s = (entry[1] == "120000") |
|
|||
210 |
|
||||
211 | if f == '.gitmodules': |
|
|||
212 | subexists = True |
|
|||
213 | if entry[4] == 'D': |
|
|||
214 | subdeleted = True |
|
|||
215 | changes.append(('.hgsub', hex(nullid))) |
|
|||
216 | else: |
|
|||
217 | changes.append(('.hgsub', '')) |
|
|||
218 | elif entry[1] == '160000' or entry[0] == ':160000': |
|
|||
219 | subexists = True |
|
|||
220 | else: |
|
|||
221 | self.modecache[(f, h)] = (p and "x") or (s and "l") or "" |
|
|||
222 | changes.append((f, h)) |
|
|||
223 | entry = None |
|
227 | entry = None | |
224 | if fh.close(): |
|
228 | if fh.close(): | |
225 | raise util.Abort(_('cannot read changes in %s') % version) |
|
229 | raise util.Abort(_('cannot read changes in %s') % version) | |
226 |
|
230 | |||
227 | if subexists: |
|
231 | if subexists[0]: | |
228 | if subdeleted: |
|
232 | if subdeleted[0]: | |
229 | changes.append(('.hgsubstate', hex(nullid))) |
|
233 | changes.append(('.hgsubstate', hex(nullid))) | |
230 | else: |
|
234 | else: | |
231 | self.retrievegitmodules(version) |
|
235 | self.retrievegitmodules(version) |
General Comments 0
You need to be logged in to leave comments.
Login now