/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Martin Pool
  • Date: 2007-10-12 06:47:49 UTC
  • mto: This revision was merged to the branch mainline in revision 2913.
  • Revision ID: mbp@sourcefrog.net-20071012064749-7t00zaab23qo5qjw
record_entry_contents should give back deltas for changed roots; clean it up a bit

Show diffs side-by-side

added added

removed removed

Lines of Context:
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)
258
256
 
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
271
 
                delta = None
272
 
            else:
 
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.
 
272
                #
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
                        ie.file_id, ie)
 
280
                else:
278
281
                    # add
279
282
                    delta = (None, path, ie.file_id, ie)
280
 
                else:
281
 
                    basis_id = basis_inv[ie.file_id]
282
 
                    if basis_id.name != '':
283
 
                        # not the root
284
 
                        delta = (basis_inv.id2path(ie.file_id), path,
285
 
                            ie.file_id, ie)
286
 
                    else:
287
 
                        # common, unaltered
288
 
                        delta = None
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)
292
 
 
 
283
                return delta, False
 
284
            else:
 
285
                # we don't need to commit this, because the caller already
 
286
                # determined that an existing revision of this file is
 
287
                # appropriate.
 
288
                delta = None
 
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)