Show More
@@ -248,8 +248,7 b' class mercurial_source(converter_source)' | |||
|
248 | 248 | return self.lastctx |
|
249 | 249 | |
|
250 | 250 | def parents(self, ctx): |
|
251 |
return [p |
|
|
252 | if p and self.keep(p.node())] | |
|
251 | return [p for p in ctx.parents() if p and self.keep(p.node())] | |
|
253 | 252 | |
|
254 | 253 | def getheads(self): |
|
255 | 254 | if self.rev: |
@@ -275,20 +274,20 b' class mercurial_source(converter_source)' | |||
|
275 | 274 | if self.ignoreerrors: |
|
276 | 275 | # calling getcopies() is a simple way to detect missing |
|
277 | 276 | # revlogs and populate self.ignored |
|
278 | self.getcopies(ctx, files) | |
|
277 | self.getcopies(ctx, parents, files) | |
|
279 | 278 | return [(f, rev) for f in files if f not in self.ignored], {} |
|
280 | 279 | if self._changescache and self._changescache[0] == rev: |
|
281 | 280 | m, a, r = self._changescache[1] |
|
282 | 281 | else: |
|
283 | m, a, r = self.repo.status(parents[0], ctx.node())[:3] | |
|
282 | m, a, r = self.repo.status(parents[0].node(), ctx.node())[:3] | |
|
284 | 283 | # getcopies() detects missing revlogs early, run it before |
|
285 | 284 | # filtering the changes. |
|
286 | copies = self.getcopies(ctx, m + a) | |
|
285 | copies = self.getcopies(ctx, parents, m + a) | |
|
287 | 286 | changes = [(name, rev) for name in m + a + r |
|
288 | 287 | if name not in self.ignored] |
|
289 | 288 | return sorted(changes), copies |
|
290 | 289 | |
|
291 | def getcopies(self, ctx, files): | |
|
290 | def getcopies(self, ctx, parents, files): | |
|
292 | 291 | copies = {} |
|
293 | 292 | for name in files: |
|
294 | 293 | if name in self.ignored: |
@@ -297,6 +296,14 b' class mercurial_source(converter_source)' | |||
|
297 | 296 | copysource, copynode = ctx.filectx(name).renamed() |
|
298 | 297 | if copysource in self.ignored or not self.keep(copynode): |
|
299 | 298 | continue |
|
299 | # Ignore copy sources not in parent revisions | |
|
300 | found = False | |
|
301 | for p in parents: | |
|
302 | if copysource in p: | |
|
303 | found = True | |
|
304 | break | |
|
305 | if not found: | |
|
306 | continue | |
|
300 | 307 | copies[name] = copysource |
|
301 | 308 | except TypeError: |
|
302 | 309 | pass |
@@ -309,7 +316,7 b' class mercurial_source(converter_source)' | |||
|
309 | 316 | |
|
310 | 317 | def getcommit(self, rev): |
|
311 | 318 | ctx = self.changectx(rev) |
|
312 |
parents = [hex( |
|
|
319 | parents = [p.hex() for p in self.parents(ctx)] | |
|
313 | 320 | if self.saverev: |
|
314 | 321 | crev = rev |
|
315 | 322 | else: |
@@ -332,7 +339,7 b' class mercurial_source(converter_source)' | |||
|
332 | 339 | changes = [], ctx.manifest().keys(), [] |
|
333 | 340 | else: |
|
334 | 341 | i = i or 0 |
|
335 | changes = self.repo.status(parents[i], ctx.node())[:3] | |
|
342 | changes = self.repo.status(parents[i].node(), ctx.node())[:3] | |
|
336 | 343 | changes = [[f for f in l if f not in self.ignored] for l in changes] |
|
337 | 344 | |
|
338 | 345 | if i == 0: |
General Comments 0
You need to be logged in to leave comments.
Login now