/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_map_py.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) 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 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
19
19
import zlib
20
20
import struct
21
21
 
22
 
from bzrlib.static_tuple import StaticTuple
23
 
 
24
22
_LeafNode = None
25
23
_InternalNode = None
26
24
_unknown = None
95
93
        value_lines = lines[pos:pos+num_value_lines]
96
94
        pos += num_value_lines
97
95
        value = '\n'.join(value_lines)
98
 
        items[StaticTuple.from_sequence(elements[:-1])] = value
 
96
        items[tuple(elements[:-1])] = value
99
97
    if len(items) != length:
100
98
        raise AssertionError("item count (%d) mismatch for key %s,"
101
99
            " bytes %r" % (length, key, bytes))
143
141
    for line in lines[5:]:
144
142
        line = common_prefix + line
145
143
        prefix, flat_key = line.rsplit('\x00', 1)
146
 
        items[prefix] = StaticTuple(flat_key,)
 
144
        items[prefix] = (flat_key,)
147
145
    if len(items) == 0:
148
146
        raise AssertionError("We didn't find any item for %s" % key)
149
147
    result._items = items
157
155
    result._node_width = len(prefix)
158
156
    result._search_prefix = common_prefix
159
157
    return result
 
158