170 % (util.timer() - start) |
170 % (util.timer() - start) |
171 ) |
171 ) |
172 return cm |
172 return cm |
173 |
173 |
174 |
174 |
175 def _revinfogetter(repo): |
175 def _revinfo_getter(repo): |
176 """return a function that return multiple data given a <rev>"i |
176 """return a function that return multiple data given a <rev>"i |
177 |
177 |
178 * p1: revision number of first parent |
178 * p1: revision number of first parent |
179 * p2: revision number of first parent |
179 * p2: revision number of first parent |
180 * p1copies: mapping of copies from p1 |
180 * p1copies: mapping of copies from p1 |
276 if a.rev() in (node.nullrev, b.rev()): |
276 if a.rev() in (node.nullrev, b.rev()): |
277 return {} |
277 return {} |
278 |
278 |
279 repo = a.repo().unfiltered() |
279 repo = a.repo().unfiltered() |
280 children = {} |
280 children = {} |
281 revinfo = _revinfogetter(repo) |
281 revinfo = _revinfo_getter(repo) |
282 |
282 |
283 cl = repo.changelog |
283 cl = repo.changelog |
284 isancestor = cl.isancestorrev # XXX we should had chaching to this. |
284 isancestor = cl.isancestorrev # XXX we should had chaching to this. |
285 missingrevs = cl.findmissingrevs(common=[a.rev()], heads=[b.rev()]) |
285 missingrevs = cl.findmissingrevs(common=[a.rev()], heads=[b.rev()]) |
286 mrset = set(missingrevs) |
286 mrset = set(missingrevs) |
307 iterrevs = set(from_head) |
307 iterrevs = set(from_head) |
308 iterrevs &= mrset |
308 iterrevs &= mrset |
309 iterrevs.update(roots) |
309 iterrevs.update(roots) |
310 iterrevs.remove(b.rev()) |
310 iterrevs.remove(b.rev()) |
311 revs = sorted(iterrevs) |
311 revs = sorted(iterrevs) |
312 return _combinechangesetcopies( |
312 return _combine_changeset_copies( |
313 revs, children, b.rev(), revinfo, match, isancestor |
313 revs, children, b.rev(), revinfo, match, isancestor |
314 ) |
314 ) |
315 |
315 |
316 |
316 |
317 def _combinechangesetcopies( |
317 def _combine_changeset_copies( |
318 revs, children, targetrev, revinfo, match, isancestor |
318 revs, children, targetrev, revinfo, match, isancestor |
319 ): |
319 ): |
320 """combine the copies information for each item of iterrevs |
320 """combine the copies information for each item of iterrevs |
321 |
321 |
322 revs: sorted iterable of revision to visit |
322 revs: sorted iterable of revision to visit |