~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Jelmer Vernooij
  • Date: 2011-05-04 22:23:20 UTC
  • mfrom: (5825 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5830.
  • Revision ID: jelmer@samba.org-20110504222320-bczsppms2wadcrb4
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
750
750
        self._set_merges_from_parent_ids(revision_ids)
751
751
 
752
752
    @needs_tree_write_lock
753
 
    def set_parent_trees(self, parents_list, allow_leftmost_as_ghost=False):
754
 
        """See MutableTree.set_parent_trees."""
755
 
        parent_ids = [rev for (rev, tree) in parents_list]
756
 
        for revision_id in parent_ids:
757
 
            _mod_revision.check_not_reserved_id(revision_id)
758
 
 
759
 
        self._check_parents_for_ghosts(parent_ids,
760
 
            allow_leftmost_as_ghost=allow_leftmost_as_ghost)
761
 
 
762
 
        parent_ids = self._filter_parent_ids_by_ancestry(parent_ids)
763
 
 
764
 
        if len(parent_ids) == 0:
765
 
            leftmost_parent_id = _mod_revision.NULL_REVISION
766
 
            leftmost_parent_tree = None
767
 
        else:
768
 
            leftmost_parent_id, leftmost_parent_tree = parents_list[0]
769
 
 
770
 
        if self._change_last_revision(leftmost_parent_id):
771
 
            if leftmost_parent_tree is None:
772
 
                # If we don't have a tree, fall back to reading the
773
 
                # parent tree from the repository.
774
 
                self._cache_basis_inventory(leftmost_parent_id)
775
 
            else:
776
 
                inv = leftmost_parent_tree.inventory
777
 
                xml = self._create_basis_xml_from_inventory(
778
 
                                        leftmost_parent_id, inv)
779
 
                self._write_basis_inventory(xml)
780
 
        self._set_merges_from_parent_ids(parent_ids)
781
 
 
782
 
    @needs_tree_write_lock
783
753
    def set_pending_merges(self, rev_list):
784
754
        parents = self.get_parent_ids()
785
755
        leftmost = parents[:1]
1977
1947
        """See Tree.iter_all_file_ids"""
1978
1948
        return set(self.inventory)
1979
1949
 
 
1950
    @needs_tree_write_lock
 
1951
    def set_parent_trees(self, parents_list, allow_leftmost_as_ghost=False):
 
1952
        """See MutableTree.set_parent_trees."""
 
1953
        parent_ids = [rev for (rev, tree) in parents_list]
 
1954
        for revision_id in parent_ids:
 
1955
            _mod_revision.check_not_reserved_id(revision_id)
 
1956
 
 
1957
        self._check_parents_for_ghosts(parent_ids,
 
1958
            allow_leftmost_as_ghost=allow_leftmost_as_ghost)
 
1959
 
 
1960
        parent_ids = self._filter_parent_ids_by_ancestry(parent_ids)
 
1961
 
 
1962
        if len(parent_ids) == 0:
 
1963
            leftmost_parent_id = _mod_revision.NULL_REVISION
 
1964
            leftmost_parent_tree = None
 
1965
        else:
 
1966
            leftmost_parent_id, leftmost_parent_tree = parents_list[0]
 
1967
 
 
1968
        if self._change_last_revision(leftmost_parent_id):
 
1969
            if leftmost_parent_tree is None:
 
1970
                # If we don't have a tree, fall back to reading the
 
1971
                # parent tree from the repository.
 
1972
                self._cache_basis_inventory(leftmost_parent_id)
 
1973
            else:
 
1974
                inv = leftmost_parent_tree.inventory
 
1975
                xml = self._create_basis_xml_from_inventory(
 
1976
                                        leftmost_parent_id, inv)
 
1977
                self._write_basis_inventory(xml)
 
1978
        self._set_merges_from_parent_ids(parent_ids)
 
1979
 
1980
1980
    def _cache_basis_inventory(self, new_revision):
1981
1981
        """Cache new_revision as the basis inventory."""
1982
1982
        # TODO: this should allow the ready-to-use inventory to be passed in,