~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/annotate.py

Updates from review comments

Show diffs side-by-side

added added

removed removed

Lines of Context:
115
115
                yield (x for x in origins if x != new_revision_id).next(), line
116
116
            else:
117
117
                yield new_revision_id, line
118
 
                       
 
118
 
119
119
 
120
120
def _reannotate(parent_lines, new_lines, new_revision_id):
121
121
    plain_parent_lines = [l for r, l in parent_lines]
122
 
    import patiencediff
123
122
    patiencediff.PatienceSequenceMatcher()
124
 
    matcher = patiencediff.PatienceSequenceMatcher(None, plain_parent_lines, 
 
123
    matcher = patiencediff.PatienceSequenceMatcher(None, plain_parent_lines,
125
124
                                                   new_lines)
126
125
    new_cur = 0
127
126
    for i, j, n in matcher.get_matching_blocks():
128
127
        for line in new_lines[new_cur:j]:
129
128
            yield new_revision_id, line
130
129
        for data in parent_lines[i:i+n]:
131
 
            yield data 
 
130
            yield data
132
131
        new_cur = j + n