/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/serializer.py

  • Committer: Andrew Bennetts
  • Date: 2009-10-21 11:13:40 UTC
  • mto: This revision was merged to the branch mainline in revision 4762.
  • Revision ID: andrew.bennetts@canonical.com-20091021111340-w7x4d5yf83qwjncc
Add test that WSGI glue allows request handlers to access paths above that request's. backing transport, so long as it is within the WSGI app's backing transport.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2009 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
 
17
 
17
18
"""Inventory/revision serialization."""
18
19
 
19
 
from __future__ import absolute_import
20
20
 
21
 
from .. import registry
 
21
from bzrlib import registry
22
22
 
23
23
 
24
24
class Serializer(object):
50
50
        raise NotImplementedError(self.write_inventory_to_string)
51
51
 
52
52
    def read_inventory_from_string(self, string, revision_id=None,
53
 
                                   entry_cache=None, return_from_cache=False):
 
53
                                   entry_cache=None):
54
54
        """Read string into an inventory object.
55
55
 
56
56
        :param string: The serialized inventory to read.
64
64
        :param entry_cache: An optional cache of InventoryEntry objects. If
65
65
            supplied we will look up entries via (file_id, revision_id) which
66
66
            should map to a valid InventoryEntry (File/Directory/etc) object.
67
 
        :param return_from_cache: Return entries directly from the cache,
68
 
            rather than copying them first. This is only safe if the caller
69
 
            promises not to mutate the returned inventory entries, but it can
70
 
            make some operations significantly faster.
71
67
        """
72
68
        raise NotImplementedError(self.read_inventory_from_string)
73
69
 
93
89
 
94
90
 
95
91
format_registry = SerializerRegistry()
96
 
format_registry.register_lazy('5', 'breezy.bzr.xml5', 'serializer_v5')
97
 
format_registry.register_lazy('6', 'breezy.bzr.xml6', 'serializer_v6')
98
 
format_registry.register_lazy('7', 'breezy.bzr.xml7', 'serializer_v7')
99
 
format_registry.register_lazy('8', 'breezy.bzr.xml8', 'serializer_v8')
100
 
format_registry.register_lazy('9', 'breezy.bzr.chk_serializer',
 
92
format_registry.register_lazy('4', 'bzrlib.xml4', 'serializer_v4')
 
93
format_registry.register_lazy('5', 'bzrlib.xml5', 'serializer_v5')
 
94
format_registry.register_lazy('6', 'bzrlib.xml6', 'serializer_v6')
 
95
format_registry.register_lazy('7', 'bzrlib.xml7', 'serializer_v7')
 
96
format_registry.register_lazy('8', 'bzrlib.xml8', 'serializer_v8')
 
97
format_registry.register_lazy('9', 'bzrlib.chk_serializer',
101
98
    'chk_serializer_255_bigpage')
102
 
format_registry.register_lazy('10', 'breezy.bzr.chk_serializer',
 
99
format_registry.register_lazy('10', 'bzrlib.chk_serializer',
103
100
    'chk_bencode_serializer')