~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/chk_map.py

  • Committer: Jelmer Vernooij
  • Date: 2011-12-16 16:40:10 UTC
  • mto: This revision was merged to the branch mainline in revision 6391.
  • Revision ID: jelmer@samba.org-20111216164010-z3hy00xrnclnkf7a
Update tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2008-2011 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
44
44
lazy_import.lazy_import(globals(), """
45
45
from bzrlib import (
46
46
    errors,
47
 
    versionedfile,
48
47
    )
49
48
""")
50
49
from bzrlib import (
 
50
    errors,
51
51
    lru_cache,
52
52
    osutils,
53
53
    registry,
920
920
        bytes = ''.join(lines)
921
921
        if len(bytes) != self._current_size():
922
922
            raise AssertionError('Invalid _current_size')
923
 
        _get_cache().add(self._key, bytes)
 
923
        _get_cache()[self._key] = bytes
924
924
        return [self._key]
925
925
 
926
926
    def refs(self):
1193
1193
                    prefix, node_key_filter = keys[record.key]
1194
1194
                    node_and_filters.append((node, node_key_filter))
1195
1195
                    self._items[prefix] = node
1196
 
                    _get_cache().add(record.key, bytes)
 
1196
                    _get_cache()[record.key] = bytes
1197
1197
                for info in node_and_filters:
1198
1198
                    yield info
1199
1199
 
1319
1319
            lines.append(serialised[prefix_len:])
1320
1320
        sha1, _, _ = store.add_lines((None,), (), lines)
1321
1321
        self._key = StaticTuple("sha1:" + sha1,).intern()
1322
 
        _get_cache().add(self._key, ''.join(lines))
 
1322
        _get_cache()[self._key] = ''.join(lines)
1323
1323
        yield self._key
1324
1324
 
1325
1325
    def _search_key(self, key):