~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/annotate.py

  • Committer: Robert Collins
  • Date: 2005-10-14 02:17:36 UTC
  • mfrom: (1185.16.34)
  • Revision ID: robertc@lifelesslap.robertcollins.net-20051014021736-7230e59066856096
MergeĀ fromĀ Martin.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
    for origin, text in w.annotate_iter(rev_id):
40
40
        text = text.rstrip('\r\n')
41
41
        if origin == last_origin:
42
 
            print '         | %s' % (text)
 
42
            anno = ''
43
43
        else:
44
44
            last_origin = origin
45
45
            line_rev_id = w.idx_to_name(origin)
46
 
            if line_rev_id in rh:
47
 
                revno = rh.index(line_rev_id) + 1
48
 
                print '%8d | %s' % (revno, text)
49
 
            elif branch.has_revision(line_rev_id):
50
 
                rev = branch.get_revision(line_rev_id)
51
 
                date_str = time.strftime('%Y%m%d', time.gmtime(rev.timestamp + rev.timezone))
52
 
                print '%8s | %s' % (date_str, text)
 
46
            if not branch.has_revision(line_rev_id):
 
47
                anno = '???'
53
48
            else:
54
 
                print '%8.8s | %s' % (line_rev_id, text)
55
 
 
 
49
                if line_rev_id in rh:
 
50
                    revno_str = str(rh.index(line_rev_id) + 1)
 
51
                else:
 
52
                    revno_str = 'merge'
 
53
            rev = branch.get_revision(line_rev_id)
 
54
            tz = rev.timezone or 0
 
55
            date_str = time.strftime('%Y%m%d', 
 
56
                                     time.gmtime(rev.timestamp + tz))
 
57
            # a lazy way to get something like the email address
 
58
            # TODO: Get real email address
 
59
            author = line_rev_id
 
60
            if '@' in author:
 
61
                author = author[:author.index('@')]
 
62
            author = author[:12]
 
63
            anno = '%5s %-12s %8s' % (revno_str, author, date_str)
 
64
        print '%-27.27s | %s' % (anno, text)
56
65
 
57
66
 
58
67
if __name__ == '__main__':