~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/annotate.py

  • Committer: Aaron Bentley
  • Date: 2006-04-07 22:46:52 UTC
  • mfrom: (1645 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1727.
  • Revision ID: aaron.bentley@utoronto.ca-20060407224652-4925bc3735b926f8
Merged latest bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
def _annotate_file(branch, rev_id, file_id ):
56
56
 
57
57
    rh = branch.revision_history()
58
 
    w = branch.weave_store.get_weave(file_id, branch.get_transaction())
 
58
    w = branch.repository.weave_store.get_weave(file_id, 
 
59
        branch.repository.get_transaction())
59
60
    last_origin = None
60
61
    for origin, text in w.annotate_iter(rev_id):
61
62
        text = text.rstrip('\r\n')
63
64
            (revno_str, author, date_str) = ('','','')
64
65
        else:
65
66
            last_origin = origin
66
 
            line_rev_id = w.idx_to_name(origin)
67
 
            if not branch.has_revision(line_rev_id):
 
67
            if not branch.repository.has_revision(origin):
68
68
                (revno_str, author, date_str) = ('?','?','?')
69
69
            else:
70
 
                if line_rev_id in rh:
71
 
                    revno_str = str(rh.index(line_rev_id) + 1)
 
70
                if origin in rh:
 
71
                    revno_str = str(rh.index(origin) + 1)
72
72
                else:
73
73
                    revno_str = 'merge'
74
 
            rev = branch.get_revision(line_rev_id)
 
74
            rev = branch.repository.get_revision(origin)
75
75
            tz = rev.timezone or 0
76
76
            date_str = time.strftime('%Y%m%d', 
77
77
                                     time.gmtime(rev.timestamp + tz))
82
82
                author = extract_email_address(author)
83
83
            except BzrError:
84
84
                pass        # use the whole name
85
 
        yield (revno_str, author, date_str, line_rev_id, text)
 
85
        yield (revno_str, author, date_str, origin, text)