~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/store/revision/text.py

  • Committer: Robert Collins
  • Date: 2006-03-06 07:14:27 UTC
  • mto: (1594.2.4 integration)
  • mto: This revision was merged to the branch mainline in revision 1596.
  • Revision ID: robertc@robertcollins.net-20060306071427-359ef15c1d891e84
Add total_size to the revision_store api.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
class TextRevisionStore(RevisionStore):
52
52
    """A RevisionStore layering on a TextStore and Inventory weave store."""
53
53
 
54
 
    def __init__(self, text_store):
 
54
    def __init__(self, text_store, serializer=None):
55
55
        """Create a TextRevisionStore object.
56
56
 
57
57
        :param text_store: the text store to put serialised revisions into.
58
58
        """
59
 
        super(TextRevisionStore, self).__init__()
 
59
        super(TextRevisionStore, self).__init__(serializer)
60
60
        self.text_store = text_store
61
61
        self.text_store.register_suffix('sig')
62
62
 
72
72
        """See RevisionStore.get_revision()."""
73
73
        xml_file = self._get_revision_xml_file(revision_id)
74
74
        try:
75
 
            r = bzrlib.xml5.serializer_v5.read_revision(xml_file)
 
75
            r = self._serializer.read_revision(xml_file)
76
76
        except SyntaxError, e:
77
77
            raise errors.BzrError('failed to unpack revision_xml',
78
78
                                   [revision_id,
91
91
        """True if the store contains revision_id."""
92
92
        return (revision_id is None
93
93
                or self.text_store.has_id(revision_id))
 
94
        
 
95
    def total_size(self, transaction):
 
96
        """ See RevisionStore.total_size()."""
 
97
        return self.text_store.total_size()