/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Lukáš Lalinský
  • Date: 2008-07-09 07:54:40 UTC
  • mto: (0.140.35 trunk)
  • mto: This revision was merged to the branch mainline in revision 6646.
  • Revision ID: lalinsky@gmail.com-20080709075440-uwu722u9x05g8hyc
Reuse sort_by_committer in get_diff_info

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
            committers.setdefault(email, []).append(rev)
91
91
    finally:
92
92
        pb.finished()
93
 
    
 
93
 
94
94
    return committers
95
95
 
96
96
 
112
112
 
113
113
def get_diff_info(a_repo, start_rev, end_rev):
114
114
    """Get only the info for new revisions between the two revisions
115
 
    
 
115
 
116
116
    This lets us figure out what has actually changed between 2 revisions.
117
117
    """
118
118
    pb = ui.ui_factory.nested_progress_bar()
119
 
    committers = {}
120
119
    a_repo.lock_read()
121
120
    try:
122
121
        pb.note('getting ancestry 1')
124
123
        pb.note('getting ancestry 2')
125
124
        ancestry = a_repo.get_ancestry(end_rev)[1:]
126
125
        ancestry = [rev for rev in ancestry if rev not in start_ancestry]
127
 
        pb.note('getting revisions')
128
 
        revisions = a_repo.get_revisions(ancestry)
129
126
 
130
 
        for count, rev in enumerate(revisions):
131
 
            pb.update('checking', count, len(ancestry))
132
 
            try:
133
 
                email = config.extract_email_address(rev.get_apparent_author())
134
 
            except errors.BzrError:
135
 
                email = rev.get_apparent_author()
136
 
            committers.setdefault(email, []).append(rev)
 
127
        committers = sort_by_committer(a_repo, ancestry)
137
128
    finally:
138
129
        a_repo.unlock()
139
130
        pb.finished()
140
131
 
141
 
    info = collapse_by_person(committers)
142
 
    return info
 
132
    return collapse_by_person(committers)
143
133
 
144
134
 
145
135
def display_info(info, to_file, gather_class_stats=None):