/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 bzr_commit_handler.py

  • Committer: Ian Clatworthy
  • Date: 2009-03-05 07:51:46 UTC
  • mto: (0.64.140 trunk)
  • mto: This revision was merged to the branch mainline in revision 6631.
  • Revision ID: ian.clatworthy@internode.on.net-20090305075146-4xsfuucy8qnunhyi
CHKInventory support for non rich-root repos working, for simple imports at least

Show diffs side-by-side

added added

removed removed

Lines of Context:
287
287
 
288
288
 
289
289
class InventoryCommitHandler(GenericCommitHandler):
290
 
    """A CommitHandler that builds and saves full inventories."""
 
290
    """A CommitHandler that builds and saves Inventory objects."""
291
291
 
292
292
    def pre_process_files(self):
293
293
        super(InventoryCommitHandler, self).pre_process_files()
417
417
        self._delete_all_items(self.inventory)
418
418
 
419
419
 
420
 
class DeltaCommitHandler(GenericCommitHandler):
421
 
    """A CommitHandler that builds and saves inventory deltas."""
 
420
class CHKInventoryCommitHandler(GenericCommitHandler):
 
421
    """A CommitHandler that builds and saves CHKInventory objects."""
422
422
 
423
423
    def pre_process_files(self):
424
 
        super(DeltaCommitHandler, self).pre_process_files()
425
 
        if self.parents:
426
 
            self.delta = []
427
 
        else:
 
424
        super(CHKInventoryCommitHandler, self).pre_process_files()
 
425
        if len(self.parents) == 0 or not self.rev_store.expects_rich_root():
428
426
            # Need to explicitly add the root entry for the first revision
 
427
            # and for non rich-root inventories
429
428
            root_id = inventory.ROOT_ID
430
429
            # XXX: We *could* make this a CHKInventoryDirectory but it
431
430
            # seems that deltas ought to use normal InventoryDirectory's
434
433
            root_ie = inventory.InventoryDirectory(root_id, u'', None)
435
434
            root_ie.revision = self.revision_id
436
435
            self.delta = [(None, '', root_id, root_ie)]
 
436
        else:
 
437
            self.delta = []
437
438
 
438
439
    def post_process_files(self):
439
440
        """Save the revision."""