750
750
self._set_merges_from_parent_ids(revision_ids)
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)
759
self._check_parents_for_ghosts(parent_ids,
760
allow_leftmost_as_ghost=allow_leftmost_as_ghost)
762
parent_ids = self._filter_parent_ids_by_ancestry(parent_ids)
764
if len(parent_ids) == 0:
765
leftmost_parent_id = _mod_revision.NULL_REVISION
766
leftmost_parent_tree = None
768
leftmost_parent_id, leftmost_parent_tree = parents_list[0]
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)
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)
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)
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)
1957
self._check_parents_for_ghosts(parent_ids,
1958
allow_leftmost_as_ghost=allow_leftmost_as_ghost)
1960
parent_ids = self._filter_parent_ids_by_ancestry(parent_ids)
1962
if len(parent_ids) == 0:
1963
leftmost_parent_id = _mod_revision.NULL_REVISION
1964
leftmost_parent_tree = None
1966
leftmost_parent_id, leftmost_parent_tree = parents_list[0]
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)
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)
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,