~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/store/weave.py

  • Committer: Martin Pool
  • Date: 2005-10-06 04:09:55 UTC
  • mfrom: (1413)
  • mto: (1185.13.3)
  • mto: This revision was merged to the branch mainline in revision 1417.
  • Revision ID: mbp@sourcefrog.net-20051006040955-36f27e5a8d5c977b
[merge] from robert

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
from bzrlib.trace import mutter
33
33
 
34
34
 
35
 
 
36
 
 
37
35
class WeaveStore(Store):
38
36
    """Collection of several weave files in a directory.
39
37
 
44
42
    def __init__(self, transport):
45
43
        self._transport = transport
46
44
        self._cache = {}
47
 
        self.enable_cache = False
 
45
        self.enable_cache = False
48
46
 
49
47
 
50
48
    def filename(self, file_id):
68
66
    def _put(self, file_id, f):
69
67
        return self._transport.put(self.filename(file_id), f)
70
68
 
71
 
 
72
69
    def get_weave(self, file_id):
73
70
        if self.enable_cache:
74
71
            if file_id in self._cache:
 
72
                mutter("cache hit in %s for %s", self, file_id)
75
73
                return self._cache[file_id]
76
74
        w = read_weave(self._get(file_id))
77
75
        if self.enable_cache: