~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/serializer.py

(vila) Fix test failures blocking package builds. (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2009 Canonical Ltd
 
1
# Copyright (C) 2009, 2010 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
 
 
18
17
"""Inventory/revision serialization."""
19
18
 
 
19
from __future__ import absolute_import
20
20
 
21
21
from bzrlib import registry
22
22
 
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):
 
53
                                   entry_cache=None, return_from_cache=False):
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.
67
71
        """
68
72
        raise NotImplementedError(self.read_inventory_from_string)
69
73
 
89
93
 
90
94
 
91
95
format_registry = SerializerRegistry()
92
 
format_registry.register_lazy('4', 'bzrlib.xml4', 'serializer_v4')
93
96
format_registry.register_lazy('5', 'bzrlib.xml5', 'serializer_v5')
94
97
format_registry.register_lazy('6', 'bzrlib.xml6', 'serializer_v6')
95
98
format_registry.register_lazy('7', 'bzrlib.xml7', 'serializer_v7')