diff options
author | Ian Clatworthy <ian.clatworthy@internode.on.net> | 2009-03-05 22:27:11 +1000 |
---|---|---|
committer | Ian Clatworthy <ian.clatworthy@internode.on.net> | 2009-03-05 22:27:11 +1000 |
commit | e50de985e09e061a4b4e656705510a75b1c0bc45 (patch) | |
tree | 464d499ed09ca3a95e1b0c95f3650e7ffca3323b /revision_store.py | |
parent | 2d9918e59c7e313253121b1caeb7d390f503449c (diff) | |
download | bzr-fastimport-e50de985e09e061a4b4e656705510a75b1c0bc45.tar.gz |
ensure the chk stuff is only used on formats actually supporting it
Diffstat (limited to 'revision_store.py')
-rw-r--r-- | revision_store.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/revision_store.py b/revision_store.py index a795931..9a135a2 100644 --- a/revision_store.py +++ b/revision_store.py @@ -33,7 +33,7 @@ class AbstractRevisionStore(object): :param repository: the target repository """ self.repo = repo - self._chk_store = getattr(repo, 'chk_bytes', None) + self._supports_chks = getattr(repo._format, 'supports_chks', False) def expects_rich_root(self): """Does this store expect inventories with rich roots?""" @@ -41,7 +41,7 @@ class AbstractRevisionStore(object): def init_inventory(self, revision_id): """Generate an inventory for a parentless revision.""" - if self._chk_store: + if self._supports_chks: inv = self._init_chk_inventory(revision_id, inventory.ROOT_ID) else: inv = inventory.Inventory(revision_id=revision_id) @@ -54,7 +54,7 @@ class AbstractRevisionStore(object): """Generate a CHKInventory for a parentless revision.""" from bzrlib import chk_map # Get the creation parameters - chk_store = self._chk_store + chk_store = self.repo.chk_bytes serializer = self.repo._format._serializer search_key_name = serializer.search_key_name maximum_size = serializer.maximum_size @@ -167,7 +167,7 @@ class AbstractRevisionStore(object): :returns: The validator(which is a sha1 digest, though what is sha'd is repository format specific) of the serialized inventory. """ - if self._chk_store and len(parents): + if self._supports_chks and len(parents): # Do we need to search for the first non-empty inventory? # parent_invs can be a longer list than parents if there # are ghosts???? |