~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 21:10:36 UTC
  • mfrom: (5825 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5829.
  • Revision ID: jelmer@samba.org-20110504211036-d4urb6cv1iud4l0e
merge bzr.dev.

Show diffs side-by-side

added added

removed removed

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