/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/workingtree_4.py

  • Committer: John Arbash Meinel
  • Date: 2008-06-02 16:09:09 UTC
  • mto: This revision was merged to the branch mainline in revision 3472.
  • Revision ID: john@arbash-meinel.com-20080602160909-u5q4mzn2ou6kz2r7
Change WT.set_parent_(ids/trees) to filter out ancestors.

This makes it impossible to trigger bug #235407, since we can't have repeated
ancestors given.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1085
1085
                raise errors.GhostRevisionUnusableHere(parents_list[0][0])
1086
1086
        real_trees = []
1087
1087
        ghosts = []
 
1088
 
 
1089
        parent_ids = [rev_id for rev_id, tree in parents_list]
 
1090
        graph = self.branch.repository.get_graph()
 
1091
        heads = graph.heads(parent_ids)
 
1092
        accepted_revisions = set()
 
1093
 
1088
1094
        # convert absent trees to the null tree, which we convert back to
1089
1095
        # missing on access.
1090
1096
        for rev_id, tree in parents_list:
 
1097
            if len(accepted_revisions) > 0:
 
1098
                # we always accept the first tree
 
1099
                if rev_id in accepted_revisions or rev_id not in heads:
 
1100
                    # We have already included either this tree, or its
 
1101
                    # descendent, so we skip it.
 
1102
                    continue
1091
1103
            _mod_revision.check_not_reserved_id(rev_id)
1092
1104
            if tree is not None:
1093
1105
                real_trees.append((rev_id, tree))
1095
1107
                real_trees.append((rev_id,
1096
1108
                    self.branch.repository.revision_tree(None)))
1097
1109
                ghosts.append(rev_id)
 
1110
            accepted_revisions.add(rev_id)
1098
1111
        dirstate.set_parent_trees(real_trees, ghosts=ghosts)
1099
1112
        self._make_dirty(reset_inventory=False)
1100
1113