~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/log.py

  • Committer: John Arbash Meinel
  • Date: 2007-04-23 17:53:30 UTC
  • mto: This revision was merged to the branch mainline in revision 2456.
  • Revision ID: john@arbash-meinel.com-20070423175330-cwzggk38xbsf4wyy
Only generate a new set when we need to. Drops 'bzr log NEWS' time from 22s => 8s

Show diffs side-by-side

added added

removed removed

Lines of Context:
304
304
    sorted_rev_list = topo_sort(rev_graph)
305
305
    ancestry = {}
306
306
    for rev in sorted_rev_list:
307
 
        rev_ancestry = set()
308
 
        if rev in weave_modifed_revisions:
309
 
            rev_ancestry.add(rev)
310
 
        for parent in rev_graph[rev]:
311
 
            rev_ancestry = rev_ancestry.union(ancestry[parent])
 
307
        parents = rev_graph[rev]
 
308
        if rev not in weave_modifed_revisions and len(parents) == 1:
 
309
            # We will not be adding anything new, so just use a reference to
 
310
            # the parent ancestry.
 
311
            rev_ancestry = ancestry[parents[0]]
 
312
        else:
 
313
            rev_ancestry = set()
 
314
            if rev in weave_modifed_revisions:
 
315
                rev_ancestry.add(rev)
 
316
            for parent in parents:
 
317
                rev_ancestry = rev_ancestry.union(ancestry[parent])
312
318
        ancestry[rev] = rev_ancestry
313
319
 
314
320
    def is_merging_rev(r):