/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 bzrlib/log.py

First cut at pluralised VersionedFiles. Some rather massive API incompatabilities, primarily because of the difficulty of coherence among competing stores.

Show diffs side-by-side

added added

removed removed

Lines of Context:
455
455
    :return: A list of (revision_id, dotted_revno, merge_depth) tuples.
456
456
    """
457
457
    # find all the revisions that change the specific file
458
 
    file_weave = branch.repository.weave_store.get_weave(file_id,
459
 
                branch.repository.get_transaction())
460
 
    weave_modifed_revisions = set(file_weave.versions())
461
458
    # build the ancestry of each revision in the graph
462
459
    # - only listing the ancestors that change the specific file.
463
460
    graph = branch.repository.get_graph()
469
466
    parent_map = dict(((key, value) for key, value in
470
467
        graph.iter_ancestry(mainline_revisions[1:]) if value is not None))
471
468
    sorted_rev_list = topo_sort(parent_map.items())
 
469
    text_keys = [(file_id, rev_id) for rev_id in sorted_rev_list]
 
470
    modified_text_versions = branch.repository.texts.get_parent_map(text_keys)
472
471
    ancestry = {}
473
472
    for rev in sorted_rev_list:
 
473
        text_key = (file_id, rev)
474
474
        parents = parent_map[rev]
475
 
        if rev not in weave_modifed_revisions and len(parents) == 1:
 
475
        if text_key not in modified_text_versions and len(parents) == 1:
476
476
            # We will not be adding anything new, so just use a reference to
477
477
            # the parent ancestry.
478
478
            rev_ancestry = ancestry[parents[0]]
479
479
        else:
480
480
            rev_ancestry = set()
481
 
            if rev in weave_modifed_revisions:
 
481
            if text_key in modified_text_versions:
482
482
                rev_ancestry.add(rev)
483
483
            for parent in parents:
484
484
                if parent not in ancestry:
502
502
    # filter from the view the revisions that did not change or merge 
503
503
    # the specific file
504
504
    return [(r, n, d) for r, n, d in view_revs_iter
505
 
            if r in weave_modifed_revisions or is_merging_rev(r)]
 
505
            if (file_id, r) in modified_text_versions or is_merging_rev(r)]
506
506
 
507
507
 
508
508
def get_view_revisions(mainline_revs, rev_nos, branch, direction,