~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: 2008-06-25 10:36:36 UTC
  • mfrom: (3350.6.12 versionedfiles)
  • Revision ID: pqm@pqm.ubuntu.com-20080625103636-6kxh4e1gmyn82f50
(mbp for robertc) VersionedFiles refactoring

Show diffs side-by-side

added added

removed removed

Lines of Context:
464
464
    :return: A list of (revision_id, dotted_revno, merge_depth) tuples.
465
465
    """
466
466
    # find all the revisions that change the specific file
467
 
    file_weave = branch.repository.weave_store.get_weave(file_id,
468
 
                branch.repository.get_transaction())
469
 
    weave_modifed_revisions = set(file_weave.versions())
470
467
    # build the ancestry of each revision in the graph
471
468
    # - only listing the ancestors that change the specific file.
472
469
    graph = branch.repository.get_graph()
478
475
    parent_map = dict(((key, value) for key, value in
479
476
        graph.iter_ancestry(mainline_revisions[1:]) if value is not None))
480
477
    sorted_rev_list = topo_sort(parent_map.items())
 
478
    text_keys = [(file_id, rev_id) for rev_id in sorted_rev_list]
 
479
    modified_text_versions = branch.repository.texts.get_parent_map(text_keys)
481
480
    ancestry = {}
482
481
    for rev in sorted_rev_list:
 
482
        text_key = (file_id, rev)
483
483
        parents = parent_map[rev]
484
 
        if rev not in weave_modifed_revisions and len(parents) == 1:
 
484
        if text_key not in modified_text_versions and len(parents) == 1:
485
485
            # We will not be adding anything new, so just use a reference to
486
486
            # the parent ancestry.
487
487
            rev_ancestry = ancestry[parents[0]]
488
488
        else:
489
489
            rev_ancestry = set()
490
 
            if rev in weave_modifed_revisions:
 
490
            if text_key in modified_text_versions:
491
491
                rev_ancestry.add(rev)
492
492
            for parent in parents:
493
493
                if parent not in ancestry:
511
511
    # filter from the view the revisions that did not change or merge 
512
512
    # the specific file
513
513
    return [(r, n, d) for r, n, d in view_revs_iter
514
 
            if r in weave_modifed_revisions or is_merging_rev(r)]
 
514
            if (file_id, r) in modified_text_versions or is_merging_rev(r)]
515
515
 
516
516
 
517
517
def get_view_revisions(mainline_revs, rev_nos, branch, direction,