753
753
self._set_merges_from_parent_ids(revision_ids)
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)
762
self._check_parents_for_ghosts(parent_ids,
763
allow_leftmost_as_ghost=allow_leftmost_as_ghost)
765
parent_ids = self._filter_parent_ids_by_ancestry(parent_ids)
767
if len(parent_ids) == 0:
768
leftmost_parent_id = _mod_revision.NULL_REVISION
769
leftmost_parent_tree = None
771
leftmost_parent_id, leftmost_parent_tree = parents_list[0]
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)
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)
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)
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)
1960
self._check_parents_for_ghosts(parent_ids,
1961
allow_leftmost_as_ghost=allow_leftmost_as_ghost)
1963
parent_ids = self._filter_parent_ids_by_ancestry(parent_ids)
1965
if len(parent_ids) == 0:
1966
leftmost_parent_id = _mod_revision.NULL_REVISION
1967
leftmost_parent_tree = None
1969
leftmost_parent_id, leftmost_parent_tree = parents_list[0]
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)
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)
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,