/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/chk_serializer.py

  • Committer: John Arbash Meinel
  • Date: 2009-06-17 19:08:25 UTC
  • mto: This revision was merged to the branch mainline in revision 4460.
  • Revision ID: john@arbash-meinel.com-20090617190825-ktfk82li57rf2im6
It seems that fetch() no longer returns the number of revisions fetched.
It still does for *some* InterRepository fetch paths, but the generic one does not.
It is also not easy to get it to, since the Source and Sink are the ones
that would know how many keys were transmitted, and they are potentially 'remote'
objects.

This was also only tested to occur as a by-product in a random 'test_commit' test.
I assume if we really wanted the assurance, we would have a per_repo or interrepo
test for it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2008 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
16
16
 
17
17
"""Serializer object for CHK based inventory storage."""
18
18
 
 
19
from cStringIO import (
 
20
    StringIO,
 
21
    )
 
22
 
19
23
from bzrlib import (
20
24
    bencode,
21
25
    cache_utf8,
22
26
    inventory,
 
27
    osutils,
23
28
    revision as _mod_revision,
 
29
    xml5,
24
30
    xml6,
25
 
    xml7,
26
31
    )
27
32
 
28
33
 
131
136
        return self.read_revision_from_string(f.read())
132
137
 
133
138
 
134
 
class CHKSerializerSubtree(BEncodeRevisionSerializer1, xml7.Serializer_v7):
 
139
class CHKSerializerSubtree(BEncodeRevisionSerializer1, xml6.Serializer_v6):
135
140
    """A CHKInventory based serializer that supports tree references"""
136
141
 
137
142
    supported_kinds = set(['file', 'directory', 'symlink', 'tree-reference'])
139
144
    revision_format_num = None
140
145
    support_altered_by_hack = False
141
146
 
142
 
    def _unpack_entry(self, elt, entry_cache=None, return_from_cache=False):
 
147
    def _unpack_entry(self, elt):
143
148
        kind = elt.tag
144
149
        if not kind in self.supported_kinds:
145
150
            raise AssertionError('unsupported entry kind %s' % kind)
152
157
            return inventory.TreeReference(file_id, name, parent_id, revision,
153
158
                                           reference_revision)
154
159
        else:
155
 
            return xml7.Serializer_v7._unpack_entry(self, elt,
156
 
                entry_cache=entry_cache, return_from_cache=return_from_cache)
 
160
            return xml6.Serializer_v6._unpack_entry(self, elt)
157
161
 
158
162
    def __init__(self, node_size, search_key_name):
159
163
        self.maximum_size = node_size
160
164
        self.search_key_name = search_key_name
161
165
 
162
166
 
163
 
class CHKSerializer(xml6.Serializer_v6):
 
167
class CHKSerializer(xml5.Serializer_v5):
164
168
    """A CHKInventory based serializer with 'plain' behaviour."""
165
169
 
166
170
    format_num = '9'