diff options
author | Ian Clatworthy <ian.clatworthy@internode.on.net> | 2009-03-05 12:28:11 +1000 |
---|---|---|
committer | Ian Clatworthy <ian.clatworthy@internode.on.net> | 2009-03-05 12:28:11 +1000 |
commit | 1383f778175264b649478c8aeab834e12c29f9eb (patch) | |
tree | 14f537ed143a8b63385d720eb02dea5db44fe394 /bzr_commit_handler.py | |
parent | 23090c2c8397ff0f327cb29272a835a6386d4307 (diff) | |
download | bzr-fastimport-1383f778175264b649478c8aeab834e12c29f9eb.tar.gz |
improved-but-not-yet-working CHKInventory support
Diffstat (limited to 'bzr_commit_handler.py')
-rw-r--r-- | bzr_commit_handler.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/bzr_commit_handler.py b/bzr_commit_handler.py index 0e2f95e..3a63e5c 100644 --- a/bzr_commit_handler.py +++ b/bzr_commit_handler.py @@ -67,7 +67,7 @@ class GenericCommitHandler(processor.CommitHandler): # Keep the basis inventory. This needs to be treated as read-only. if len(self.parents) == 0: - self.basis_inventory = self.init_inventory() + self.basis_inventory = self._init_inventory() else: self.basis_inventory = self.get_inventory(self.parents[0]) self.inventory_root = self.basis_inventory.root @@ -75,13 +75,8 @@ class GenericCommitHandler(processor.CommitHandler): # directory-path -> inventory-entry for current inventory self.directory_entries = dict(self.basis_inventory.directories()) - def init_inventory(self): - """Generate an inventory for a parentless revision.""" - inv = inventory.Inventory(revision_id=self.revision_id) - if self.rev_store.expects_rich_root(): - # The very first root needs to have the right revision - inv.root.revision = self.revision_id - return inv + def _init_inventory(self): + return self.rev_store.init_inventory(self.revision_id) def get_inventory(self, revision_id): """Get the inventory for a revision id.""" @@ -121,7 +116,7 @@ class GenericCommitHandler(processor.CommitHandler): inv = self.get_inventory(revision_id) present.append(revision_id) except: - inv = self.init_inventory() + inv = self._init_inventory() self.cache_mgr.inventories[revision_id] = inv inventories.append(inv) return present, inventories @@ -429,7 +424,7 @@ class DeltaCommitHandler(GenericCommitHandler): # print "ie for %s:\n%r" % (path, entry) #print "delta:\n%r" % (self.delta,) rev = self.build_revision() - inv = self.rev_store.load_using_delta(rev, self.basis_inventory, + inv = self.rev_store.chk_load(rev, self.basis_inventory, self.delta, None, lambda file_id: self._get_lines(file_id), lambda revision_ids: self._get_inventories(revision_ids)) |