~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/chk_map.py

  • Committer: Patch Queue Manager
  • Date: 2014-09-22 19:14:34 UTC
  • mfrom: (6598.1.2 bzr)
  • Revision ID: pqm@pqm.ubuntu.com-20140922191434-6bbnpnxi5jab4vim
(richard-wilbur) Allows launchpad APIs to use proxies by default(Paul Gear).
 (Paul Gear)

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
37
37
 
38
38
"""
39
39
 
 
40
from __future__ import absolute_import
 
41
 
40
42
import heapq
41
43
import threading
42
44
 
44
46
lazy_import.lazy_import(globals(), """
45
47
from bzrlib import (
46
48
    errors,
47
 
    versionedfile,
48
49
    )
49
50
""")
50
51
from bzrlib import (
 
52
    errors,
51
53
    lru_cache,
52
54
    osutils,
53
55
    registry,
920
922
        bytes = ''.join(lines)
921
923
        if len(bytes) != self._current_size():
922
924
            raise AssertionError('Invalid _current_size')
923
 
        _get_cache().add(self._key, bytes)
 
925
        _get_cache()[self._key] = bytes
924
926
        return [self._key]
925
927
 
926
928
    def refs(self):
1193
1195
                    prefix, node_key_filter = keys[record.key]
1194
1196
                    node_and_filters.append((node, node_key_filter))
1195
1197
                    self._items[prefix] = node
1196
 
                    _get_cache().add(record.key, bytes)
 
1198
                    _get_cache()[record.key] = bytes
1197
1199
                for info in node_and_filters:
1198
1200
                    yield info
1199
1201
 
1319
1321
            lines.append(serialised[prefix_len:])
1320
1322
        sha1, _, _ = store.add_lines((None,), (), lines)
1321
1323
        self._key = StaticTuple("sha1:" + sha1,).intern()
1322
 
        _get_cache().add(self._key, ''.join(lines))
 
1324
        _get_cache()[self._key] = ''.join(lines)
1323
1325
        yield self._key
1324
1326
 
1325
1327
    def _search_key(self, key):