##// END OF EJS Templates
Merge with -crew-stable
Matt Mackall -
r9533:e151b66b merge default
parent child Browse files
Show More
@@ -248,8 +248,7 b' class mercurial_source(converter_source)'
248 return self.lastctx
248 return self.lastctx
249
249
250 def parents(self, ctx):
250 def parents(self, ctx):
251 return [p.node() for p in ctx.parents()
251 return [p for p in ctx.parents() if p and self.keep(p.node())]
252 if p and self.keep(p.node())]
253
252
254 def getheads(self):
253 def getheads(self):
255 if self.rev:
254 if self.rev:
@@ -275,20 +274,20 b' class mercurial_source(converter_source)'
275 if self.ignoreerrors:
274 if self.ignoreerrors:
276 # calling getcopies() is a simple way to detect missing
275 # calling getcopies() is a simple way to detect missing
277 # revlogs and populate self.ignored
276 # revlogs and populate self.ignored
278 self.getcopies(ctx, files)
277 self.getcopies(ctx, parents, files)
279 return [(f, rev) for f in files if f not in self.ignored], {}
278 return [(f, rev) for f in files if f not in self.ignored], {}
280 if self._changescache and self._changescache[0] == rev:
279 if self._changescache and self._changescache[0] == rev:
281 m, a, r = self._changescache[1]
280 m, a, r = self._changescache[1]
282 else:
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 # getcopies() detects missing revlogs early, run it before
283 # getcopies() detects missing revlogs early, run it before
285 # filtering the changes.
284 # filtering the changes.
286 copies = self.getcopies(ctx, m + a)
285 copies = self.getcopies(ctx, parents, m + a)
287 changes = [(name, rev) for name in m + a + r
286 changes = [(name, rev) for name in m + a + r
288 if name not in self.ignored]
287 if name not in self.ignored]
289 return sorted(changes), copies
288 return sorted(changes), copies
290
289
291 def getcopies(self, ctx, files):
290 def getcopies(self, ctx, parents, files):
292 copies = {}
291 copies = {}
293 for name in files:
292 for name in files:
294 if name in self.ignored:
293 if name in self.ignored:
@@ -297,6 +296,14 b' class mercurial_source(converter_source)'
297 copysource, copynode = ctx.filectx(name).renamed()
296 copysource, copynode = ctx.filectx(name).renamed()
298 if copysource in self.ignored or not self.keep(copynode):
297 if copysource in self.ignored or not self.keep(copynode):
299 continue
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 copies[name] = copysource
307 copies[name] = copysource
301 except TypeError:
308 except TypeError:
302 pass
309 pass
@@ -309,7 +316,7 b' class mercurial_source(converter_source)'
309
316
310 def getcommit(self, rev):
317 def getcommit(self, rev):
311 ctx = self.changectx(rev)
318 ctx = self.changectx(rev)
312 parents = [hex(p) for p in self.parents(ctx)]
319 parents = [p.hex() for p in self.parents(ctx)]
313 if self.saverev:
320 if self.saverev:
314 crev = rev
321 crev = rev
315 else:
322 else:
@@ -332,7 +339,7 b' class mercurial_source(converter_source)'
332 changes = [], ctx.manifest().keys(), []
339 changes = [], ctx.manifest().keys(), []
333 else:
340 else:
334 i = i or 0
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 changes = [[f for f in l if f not in self.ignored] for l in changes]
343 changes = [[f for f in l if f not in self.ignored] for l in changes]
337
344
338 if i == 0:
345 if i == 0:
General Comments 0
You need to be logged in to leave comments. Login now