~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/log.py

  • Committer: Robert Collins
  • Date: 2008-03-26 21:42:35 UTC
  • mto: This revision was merged to the branch mainline in revision 3313.
  • Revision ID: robertc@robertcollins.net-20080326214235-3wmnqamcgytwif89
 * ``VersionedFile.get_graph`` is deprecated, with no replacement method.
   The method was size(history) and not desirable. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
459
459
    weave_modifed_revisions = set(file_weave.versions())
460
460
    # build the ancestry of each revision in the graph
461
461
    # - only listing the ancestors that change the specific file.
462
 
    rev_graph = branch.repository.get_revision_graph(mainline_revisions[-1])
463
 
    sorted_rev_list = topo_sort(rev_graph)
 
462
    graph = branch.repository.get_graph()
 
463
    # This asks for all mainline revisions, which means we only have to spider
 
464
    # sideways, rather than depth history. That said, its still size-of-history
 
465
    # and should be addressed.
 
466
    search = graph._make_breadth_first_searcher(mainline_revisions)
 
467
    transitive_ids = set()
 
468
    map(transitive_ids.update, list(search))
 
469
    parent_map = graph.get_parent_map(transitive_ids)
 
470
    sorted_rev_list = topo_sort(parent_map.items())
464
471
    ancestry = {}
465
472
    for rev in sorted_rev_list:
466
 
        parents = rev_graph[rev]
 
473
        parents = parent_map[rev]
467
474
        if rev not in weave_modifed_revisions and len(parents) == 1:
468
475
            # We will not be adding anything new, so just use a reference to
469
476
            # the parent ancestry.
477
484
        ancestry[rev] = rev_ancestry
478
485
 
479
486
    def is_merging_rev(r):
480
 
        parents = rev_graph[r]
 
487
        parents = parent_map[r]
481
488
        if len(parents) > 1:
482
489
            leftparent = parents[0]
483
490
            for rightparent in parents[1:]:
505
512
        for revision_id in revision_ids:
506
513
            yield revision_id, str(rev_nos[revision_id]), 0
507
514
        return
 
515
    graph = branch.repository.get_graph()
 
516
    # This asks for all mainline revisions, which means we only have to spider
 
517
    # sideways, rather than depth history. That said, its still size-of-history
 
518
    # and should be addressed.
 
519
    search = graph._make_breadth_first_searcher(mainline_revs)
 
520
    transitive_ids = set()
 
521
    map(transitive_ids.update, list(search))
 
522
    parent_map = graph.get_parent_map(transitive_ids)
 
523
    # filter out ghosts; merge_sort errors on ghosts.
 
524
    rev_graph = {}
 
525
    # Filter ghosts, and null:
 
526
    if NULL_REVISION in parent_map:
 
527
        del parent_map[NULL_REVISION]
 
528
    for key, parents in parent_map.iteritems():
 
529
        rev_graph[key] = tuple(parent for parent in parents if parent in
 
530
            parent_map)
508
531
    merge_sorted_revisions = merge_sort(
509
 
        branch.repository.get_revision_graph(mainline_revs[-1]),
 
532
        rev_graph,
510
533
        mainline_revs[-1],
511
534
        mainline_revs,
512
535
        generate_revno=True)