~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/annotate.py

  • Committer: John Arbash Meinel
  • Date: 2008-07-08 14:55:19 UTC
  • mfrom: (3530 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3532.
  • Revision ID: john@arbash-meinel.com-20080708145519-paqg4kjwbpgs2xmq
Merge bzr.dev 3530

Show diffs side-by-side

added added

removed removed

Lines of Context:
111
111
 
112
112
 
113
113
def _annotations(repo, file_id, rev_id):
114
 
    """Return the list of (origin,text) for a revision of a file in a repository."""
115
 
    w = repo.weave_store.get_weave(file_id, repo.get_transaction())
116
 
    return list(w.annotate_iter(rev_id))
 
114
    """Return the list of (origin_revision_id, line_text) for a revision of a file in a repository."""
 
115
    annotations = repo.texts.annotate((file_id, rev_id))
 
116
    # 
 
117
    return [(key[-1], line) for (key, line) in annotations]
117
118
 
118
119
 
119
120
def _annotate_file(branch, rev_id, file_id):
311
312
    :param heads_provider: When parents disagree on the lineage of a line, we
312
313
        need to check if one side supersedes the other.
313
314
    """
314
 
    assert len(new_lines) == len(annotated_lines)
 
315
    if len(new_lines) != len(annotated_lines):
 
316
        raise AssertionError("mismatched new_lines and annotated_lines")
315
317
    # First compare the newly annotated lines with the right annotated lines.
316
318
    # Lines which were not changed in left or right should match. This tends to
317
319
    # be the bulk of the lines, and they will need no further processing.
341
343
        last_right_idx = right_idx + match_len
342
344
        last_left_idx = left_idx + match_len
343
345
        # If left and right agree on a range, just push that into the output
344
 
        assert len(lines) == left_idx
345
346
        lines_extend(annotated_lines[left_idx:left_idx + match_len])
346
347
    return lines