157
157
def finish_inventory(self):
158
158
"""Tell the builder that the inventory is finished."""
159
159
if self.new_inventory.root is None:
160
symbol_versioning.warn('Root entry should be supplied to'
160
raise AssertionError('Root entry should be supplied to'
161
161
' record_entry_contents, as of bzr 0.10.',
162
162
DeprecationWarning, stacklevel=2)
163
163
self.new_inventory.add(InventoryDirectory(ROOT_ID, '', None))
253
253
# mismatch between commit builder logic and repository:
254
254
# this needs the entry creation pushed down into the builder.
255
255
raise NotImplementedError('Missing repository subtree support.')
256
# transitional assert only, will remove before release.
257
assert ie.kind == kind
258
256
self.new_inventory.add(ie)
260
258
# TODO: slow, take it out of the inner loop.
267
265
# for committing. We may record the previous parents revision if the
268
266
# content is actually unchanged against a sole head.
269
267
if ie.revision is not None:
270
if self._versioned_root or path != '':
271
# not considered for commit
268
if not self._versioned_root and path == '':
274
269
# repositories that do not version the root set the root's
275
270
# revision to the new commit even when no change occurs, and
276
271
# this masks when a change may have occurred against the basis,
277
272
# so calculate if one happened.
278
if ie.file_id not in basis_inv:
273
if ie.file_id in basis_inv:
274
delta = (basis_inv.id2path(ie.file_id), path,
280
278
delta = (None, path, ie.file_id, ie)
282
basis_id = basis_inv[ie.file_id]
283
if basis_id.name != '':
285
delta = (basis_inv.id2path(ie.file_id), path,
290
# not considered for commit, OR, for non-rich-root
291
return delta, ie.revision == self._new_revision_id and (path != '' or
292
self._versioned_root)
281
# we don't need to commit this, because the caller already
282
# determined that an existing revision of this file is
284
return None, (ie.revision == self._new_revision_id)
294
285
# XXX: Friction: parent_candidates should return a list not a dict
295
286
# so that we don't have to walk the inventories again.
296
287
parent_candiate_entries = ie.parent_candidates(parent_invs)