252
252
# mismatch between commit builder logic and repository:
253
253
# this needs the entry creation pushed down into the builder.
254
254
raise NotImplementedError('Missing repository subtree support.')
255
# transitional assert only, will remove before release.
256
assert ie.kind == kind
257
255
self.new_inventory.add(ie)
259
257
# TODO: slow, take it out of the inner loop.
266
264
# for committing. We may record the previous parents revision if the
267
265
# content is actually unchanged against a sole head.
268
266
if ie.revision is not None:
269
if self._versioned_root or path != '':
270
# not considered for commit
267
if not self._versioned_root and path == '':
268
# XXX: It looks like this is only hit when _check_root decided
269
# to set a new revision on the root. We seem to be overriding
270
# ie.revision being set at this point to mean either its an
271
# unversioned root, or that it's an unchanged file.
273
273
# repositories that do not version the root set the root's
274
274
# revision to the new commit even when no change occurs, and
275
275
# this masks when a change may have occurred against the basis,
276
276
# so calculate if one happened.
277
if ie.file_id not in basis_inv:
277
if ie.file_id in basis_inv:
278
delta = (basis_inv.id2path(ie.file_id), path,
279
282
delta = (None, path, ie.file_id, ie)
281
basis_id = basis_inv[ie.file_id]
282
if basis_id.name != '':
284
delta = (basis_inv.id2path(ie.file_id), path,
289
# not considered for commit, OR, for non-rich-root
290
return delta, ie.revision == self._new_revision_id and (path != '' or
291
self._versioned_root)
285
# we don't need to commit this, because the caller already
286
# determined that an existing revision of this file is
289
return delta, ie.revision == self._new_revision_id
293
290
# XXX: Friction: parent_candidates should return a list not a dict
294
291
# so that we don't have to walk the inventories again.
295
292
parent_candiate_entries = ie.parent_candidates(parent_invs)