285 except KeyError: |
285 except KeyError: |
286 # nullrev or other branch |
286 # nullrev or other branch |
287 continue |
287 continue |
288 inrangep, linerange1 = _changesrange(c, p, linerange2, diffopts) |
288 inrangep, linerange1 = _changesrange(c, p, linerange2, diffopts) |
289 inrange = inrange or inrangep |
289 inrange = inrange or inrangep |
290 # If revision 'i' has been seen (it's a merge), we assume that its |
290 # If revision 'i' has been seen (it's a merge) and the line range |
291 # line range is the same independently of which parents was used |
291 # previously computed differs from the one we just got, we take the |
292 # to compute it. |
292 # surrounding interval. This is conservative but avoids loosing |
293 assert i not in seen or seen[i][1] == linerange1, ( |
293 # information. |
294 'computed line range for %s is not consistent between ' |
294 if i in seen and seen[i][1] != linerange1: |
295 'ancestor branches' % c) |
295 lbs, ubs = zip(linerange1, seen[i][1]) |
|
296 linerange1 = min(lbs), max(ubs) |
296 seen[i] = c, linerange1 |
297 seen[i] = c, linerange1 |
297 if inrange: |
298 if inrange: |
298 yield c, linerange1 |
299 yield c, linerange1 |
299 |
300 |
300 def toposort(revs, parentsfunc, firstbranch=()): |
301 def toposort(revs, parentsfunc, firstbranch=()): |