~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/chk_map.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-10-05 21:15:13 UTC
  • mfrom: (5448.3.5 374700-Add-gnu-lsh-support)
  • Revision ID: pqm@pqm.ubuntu.com-20101005211513-whouyj5t7oo92gmq
(gz) Add support for GNU lsh as a secure shell client (Matthew Gordon)

Show diffs side-by-side

added added

removed removed

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