77
77
rev_file = self.get_revision_file(transaction)
78
78
return rev_file.get_ancestry(rev_file.versions())
80
def get_revision(self, revision_id, transaction):
81
"""See RevisionStore.get_revision()."""
82
xml = self._get_revision_xml(revision_id, transaction)
80
def get_revisions(self, revision_ids, transaction):
81
"""See RevisionStore.get_revisions()."""
82
texts = self._get_serialized_revisions(revision_ids, transaction)
84
r = self._serializer.read_revision_from_string(xml)
85
for text, revision_id in zip(texts, revision_ids):
86
r = self._serializer.read_revision_from_string(text)
87
assert r.revision_id == revision_id
85
89
except SyntaxError, e:
86
90
raise errors.BzrError('failed to unpack revision_xml',
89
assert r.revision_id == revision_id
95
def _get_serialized_revisions(self, revision_ids, transaction):
97
vf = self.get_revision_file(transaction)
99
return vf.get_texts(revision_ids)
100
except (errors.RevisionNotPresent), e:
101
raise errors.NoSuchRevision(self, e.revision_id)
92
103
def _get_revision_xml(self, revision_id, transaction):
122
133
def total_size(self, transaction):
123
134
""" See RevisionStore.total_size()."""
124
return (len(self.all_revision_ids(transaction)),
135
return (len(self.all_revision_ids(transaction)),
125
136
self.versioned_file_store.total_size()[1])