diff options
author | Ian Clatworthy <ian.clatworthy@canonical.com> | 2009-02-20 18:11:57 +1000 |
---|---|---|
committer | Ian Clatworthy <ian.clatworthy@canonical.com> | 2009-02-20 18:11:57 +1000 |
commit | c95ed35583f4f7100744de56eaf44546e4264c7d (patch) | |
tree | 7326942ab640c25f3e6d0d4e4aeed5ced2950751 /revision_store.py | |
parent | 6ebac79d452fc7a7792533fa649bf8e6f71c8be6 (diff) | |
download | bzr-fastimport-c95ed35583f4f7100744de56eaf44546e4264c7d.tar.gz |
get DeltaCommitHandler passing all tests
Diffstat (limited to 'revision_store.py')
-rw-r--r-- | revision_store.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/revision_store.py b/revision_store.py index 6f088a2..8811bc0 100644 --- a/revision_store.py +++ b/revision_store.py @@ -88,6 +88,29 @@ class AbstractRevisionStore(object): self.repo.add_signature_text(rev.revision_id, signature) self._add_revision(rev, inv) + def load_using_delta(self, rev, basis_inv, inv_delta, signature, + text_provider, inventories_provider=None): + """Load a revision. + + :param rev: the Revision + :param basis_inv: the basis inventory + :param inv_delta: the inventory delta + :param signature: signing information + :param text_provider: a callable expecting a file_id parameter + that returns the text for that file-id + :param inventories_provider: a callable expecting a repository and + a list of revision-ids, that returns: + * the list of revision-ids present in the repository + * the list of inventories for the revision-id's, + including an empty inventory for the missing revisions + If None, a default implementation is provided. + """ + inv = basis_inv.copy() + inv.apply_delta(inv_delta) + inv.root.revision = rev.revision_id + self.load(rev, inv, signature, text_provider, inventories_provider) + return inv + def _load_texts(self, revision_id, entries, parent_invs, text_provider): """Load texts to a repository for inventory entries. |