~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge.py

Merge direct pack access branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
458
458
    @deprecated_method(deprecated_in((2, 1, 0)))
459
459
    def file_revisions(self, file_id):
460
460
        self.ensure_revision_trees()
 
461
        def get_id(tree, file_id):
 
462
            revision_id = tree.inventory[file_id].revision
 
463
            return revision_id
461
464
        if self.this_rev_id is None:
462
465
            if self.this_basis_tree.get_file_sha1(file_id) != \
463
466
                self.this_tree.get_file_sha1(file_id):
464
467
                raise errors.WorkingTreeNotRevision(self.this_tree)
465
468
 
466
469
        trees = (self.this_basis_tree, self.other_tree)
467
 
        return [tree.get_file_revision(file_id) for tree in trees]
 
470
        return [get_id(tree, file_id) for tree in trees]
468
471
 
469
472
    @deprecated_method(deprecated_in((2, 1, 0)))
470
473
    def check_basis(self, check_clean, require_commits=True):
563
566
 
564
567
    def _maybe_fetch(self, source, target, revision_id):
565
568
        if not source.repository.has_same_location(target.repository):
566
 
            target.fetch(source, revision_id)
 
569
            try:
 
570
                tags_to_fetch = set(source.tags.get_reverse_tag_dict())
 
571
            except errors.TagsNotSupported:
 
572
                tags_to_fetch = None
 
573
            fetch_spec = _mod_graph.NotInOtherForRevs(target.repository,
 
574
                source.repository, [revision_id],
 
575
                if_present_ids=tags_to_fetch).execute()
 
576
            target.fetch(source, fetch_spec=fetch_spec)
567
577
 
568
578
    def find_base(self):
569
579
        revisions = [_mod_revision.ensure_null(self.this_basis),
901
911
        """
902
912
        result = []
903
913
        iterator = self.other_tree.iter_changes(self.base_tree,
904
 
                specific_files=self.interesting_files,
 
914
                include_unchanged=True, specific_files=self.interesting_files,
905
915
                extra_trees=[self.this_tree])
906
916
        this_entries = dict((e.file_id, e) for p, e in
907
917
                            self.this_tree.iter_entries_by_dir(
1116
1126
        # 'other_tree.inventory.root' is not present in this tree. We are
1117
1127
        # calling adjust_path for children which *want* to be present with a
1118
1128
        # correct place to go.
1119
 
        for _, child in self.other_tree.inventory.root.children.iteritems():
 
1129
        for thing, child in self.other_tree.inventory.root.children.iteritems():
1120
1130
            trans_id = self.tt.trans_id_file_id(child.file_id)
1121
1131
            if not other_root_is_present:
1122
1132
                if self.tt.final_kind(trans_id) is not None:
1124
1134
                    # to go already.
1125
1135
                    continue
1126
1136
            # Move the item into the root
1127
 
            try:
1128
 
                final_name = self.tt.final_name(trans_id)
1129
 
            except errors.NoFinalPath:
1130
 
                # This file is not present anymore, ignore it.
1131
 
                continue
1132
 
            self.tt.adjust_path(final_name, self.tt.root, trans_id)
 
1137
            self.tt.adjust_path(self.tt.final_name(trans_id),
 
1138
                                self.tt.root, trans_id)
1133
1139
        if other_root_is_present:
1134
1140
            self.tt.cancel_creation(other_root)
1135
1141
            self.tt.cancel_versioning(other_root)