1145
1145
_mod_revision.NULL_REVISION)))
1146
1146
ghosts.append(rev_id)
1147
1147
accepted_revisions.add(rev_id)
1148
dirstate.set_parent_trees(real_trees, ghosts=ghosts)
1149
if (len(real_trees) == 1
1151
and self.branch.repository._format.fast_deltas
1152
and isinstance(real_trees[0][1],
1153
revisiontree.InventoryRevisionTree)
1154
and self.get_parent_ids()):
1155
rev_id, rev_tree = real_trees[0]
1156
basis_id = self.get_parent_ids()[0]
1157
# There are times when basis_tree won't be in
1158
# self.branch.repository, (switch, for example)
1160
basis_tree = self.branch.repository.revision_tree(basis_id)
1161
except errors.NoSuchRevision:
1162
# Fall back to the set_parent_trees(), since we can't use
1163
# _make_delta if we can't get the RevisionTree
1166
delta = rev_tree.inventory._make_delta(basis_tree.inventory)
1167
dirstate.update_basis_by_delta(delta, rev_id)
1170
dirstate.set_parent_trees(real_trees, ghosts=ghosts)
1149
1171
self._make_dirty(reset_inventory=False)
1151
1173
def _set_root_id(self, file_id):
1172
1194
def unlock(self):
1173
1195
"""Unlock in format 4 trees needs to write the entire dirstate."""
1174
# do non-implementation specific cleanup
1177
1196
if self._control_files._lock_count == 1:
1197
# do non-implementation specific cleanup
1178
1200
# eventually we should do signature checking during read locks for
1179
1201
# dirstate updates.
1180
1202
if self._control_files._lock_mode == 'w':
1453
1475
"""See WorkingTreeFormat.initialize().
1455
1477
:param revision_id: allows creating a working tree at a different
1456
revision than the branch is at.
1478
revision than the branch is at.
1457
1479
:param accelerator_tree: A tree which can be used for retrieving file
1458
1480
contents more quickly than the revision tree, i.e. a workingtree.
1459
1481
The revision tree will be used for cases where accelerator_tree's