~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/hashcache.py

  • Committer: Martin Pool
  • Date: 2005-09-13 23:42:32 UTC
  • mto: (1185.8.2) (974.1.91)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: mbp@sourcefrog.net-20050913234232-4d901f2d843a35f3
- ignore .DS_Store by default

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
# TODO: Perhaps return more details on the file to avoid statting it
24
24
# again: nonexistent, file type, size, etc
25
25
 
26
 
# TODO: Perhaps use a Python pickle instead of a text file; might be faster.
27
 
 
28
26
 
29
27
 
30
28
CACHE_HEADER = "### bzr hashcache v5\n"
33
31
 
34
32
from bzrlib.osutils import sha_file
35
33
from bzrlib.trace import mutter, warning
36
 
from bzrlib.atomicfile import AtomicFile
37
 
 
38
34
 
39
35
 
40
36
 
189
185
 
190
186
    def write(self):
191
187
        """Write contents of cache to file."""
 
188
        from atomicfile import AtomicFile
 
189
 
192
190
        outf = AtomicFile(self.cache_file_name(), 'wb')
193
191
        try:
194
192
            print >>outf, CACHE_HEADER,