~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/log.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-06-18 03:22:46 UTC
  • mfrom: (1756.2.17 log.perf)
  • Revision ID: pqm@pqm.ubuntu.com-20060618032246-5be492b564b839d5
Implement get_revisions efficiently, optimize log for screenfuls of text

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
 
52
52
 
53
53
# TODO: option to show delta summaries for merged-in revisions
 
54
from itertools import izip
54
55
import re
55
56
 
56
57
from bzrlib.delta import compare_trees
232
233
    for index, rev_id in cut_revs:
233
234
        rev_nos[rev_id] = index
234
235
 
235
 
    revisions = branch.repository.get_revisions([r for s, r, m, e in
236
 
                                                 merge_sorted_revisions])
237
 
 
 
236
    def iter_revisions():
 
237
        revision_ids = [r for s, r, m, e in merge_sorted_revisions]
 
238
        num = 9
 
239
        while revision_ids:
 
240
            revisions = branch.repository.get_revisions(revision_ids[:num])
 
241
            for revision in revisions:
 
242
                yield revision
 
243
            revision_ids  = revision_ids[num:]
 
244
            num = int(num * 1.5)
 
245
            
 
246
        revisions = branch.repository.get_revisions()
 
247
        for revision in revisions:
 
248
            yield revision
238
249
    # now we just print all the revisions
239
250
    for ((sequence, rev_id, merge_depth, end_of_merge), rev) in \
240
 
        zip(merge_sorted_revisions, revisions):
 
251
        izip(merge_sorted_revisions, iter_revisions()):
241
252
 
242
253
        if searchRE:
243
254
            if not searchRE.search(rev.message):